Assume the variable name references a string. Write a for loop that prints each character letter in the string. The actual print statement is provided.

Checkpoint 8.1

Assume the variable name references a string. Write a for loop that prints each character letter in the string. The actual print statement is provided.

Don't use plagiarized sources. Get Your Custom Essay on
Assume the variable name references a string. Write a for loop that prints each character letter in the string. The actual print statement is provided.
Just from $8 /Page 0r 300 words
Order Now

# What goes here?
print(letter)

Save your time - order a paper!

Get your paper written from scratch within the tight deadline. Our service is a reliable solution to all your troubles. Place an order on any task and we will take care of it. You won’t have to worry about the quality and deadlines

Order Paper Now

Checkpoint 8.11

Write an if statement using the in operator that determines whether ‘d’ is in my_string. A print statement that might be placed after the if statement is included.

# What goes here?
print(‘Yes, it is there.’)

Checkpoint 8.13

Write the first if statement to complete the code below. The block should display “Digit” if the string referenced by the variable ch contains a numeric digit. Otherwise, it should display “No digit.

# What goes here?
⋅⋅⋅⋅print(‘Digit’)
else:
⋅⋅⋅⋅print(‘No digit’)

(Note: The ⋅⋅⋅⋅ symbols represent indentation.)

Checkpoint 8.15

The code below asks the user “Do you want to repeat the program or quit? (R/Q)”. A loop should repeat until the user has entered an R or Q (either uppercase or lowercase). Replace the second line with the appropriate while statement.

again = input(‘Do you want to repeat ‘ +
⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅’the program or quit? (R/Q) ‘)
# What goes here?
⋅⋅⋅⋅again = input(‘Do you want to repeat the ‘ +
⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅’program or quit? (R/Q) ‘)

(Note: The ⋅⋅⋅⋅ symbols represent indentation.)

Checkpoint 8.17

A loop counts the number of uppercase characters that appear in the string referenced by the variable mystring. Replace the second statement with the appropriate if statement.

for letter in mystring:
⋅⋅⋅⋅# What goes here?
⋅⋅⋅⋅count += 1

(Note: The ⋅⋅⋅⋅ symbols represent indentation.)

Checkpoint 8.18

Assume the following statement appears in a program:
days = ‘Monday Tuesday Wednesday’

Write a statement that splits the string, creating the following list named my_list:
[‘Monday’, ‘Tuesday’, ‘Wednesday’]

Checkpoint 8.19

Assume the following statement appears in a program:
values = ‘one$two$three$four’
Assume the variable name references a string. Write a for loop that prints each character letter in the string. The actual print statement is provided.
Write a statement that splits the string, creating the following list named my_list:
[‘one’, ‘two’, ‘three’, ‘four’]

 

In: Computer Science

Looking for a similar assignment? Get help from our qualified experts!

Order Now