Skip to main content

Section 7.19 Write Code Questions Orig

Activity 7.19.1.

Fix the code so that only โ€œmeowโ€ is printed.

Activity 7.19.2.

Arrange the blocks on the right side so that only "meow" is printed.

Activity 7.19.3.

Create a function named count that accepts a string and a letter as arguments, then returns the count of that letter in the string. For example, if the function call was count("banana", "a") it would return 3. Hint: use the count method.

Activity 7.19.4.

Create a function named count that accepts a string and a letter as arguments, then returns the count of that letter in the string. For example, if the function call was count("banana", "a") it would return 3. Hint: use the count method.

Activity 7.19.5.

In Robert McCloskeyโ€™s book Make Way for Ducklings, the names of the ducklings are Jack, Kack, Lack, Mack, Nack, Ouack, Pack, and Quack. The following loop tries to output these names in order. Of course, thatโ€™s not quite right because Ouack and Quack are misspelled. Can you fix it?

Activity 7.19.6.

In Robert McCloskeyโ€™s book Make Way for Ducklings, the names of the ducklings are Jack, Kack, Lack, Mack, Nack, Ouack, Pack, and Quack. The following loop tries to output these names in order. Of course, thatโ€™s not quite right because Ouack and Quack are misspelled. Can you put the blocks in order to fix it?

Activity 7.19.7.

Write code to print out the statement โ€œHi my name is Bob2โ€ using only string methods or string slicing. You must get every part of the new string from the given strings, not by using string literals. Name the final string statement.

Activity 7.19.8.

Create code to print out the statement โ€œHi my name is Bob2โ€ using only string methods or string slicing. You must get every part of the new string from the given strings, not by using string literals. Name the final string statement.

Activity 7.19.9.

Write a program that asks for user input and prints their input in all lowercase, as well as the length of their string.

Activity 7.19.10.

Create a program that asks for user input and prints their input in all lowercase, as well as the length of their string.
You have attempted of activities on this page.