Py4e: Chapter 6- Questions and Answers|
Latest Update
How would you use the index operator [ ] to print out the letter q from the following string?
x = 'From ' print(x[8])
How would you use string slicing [:] to print out 'uct' from the following string?
x = 'From ' print(x[14:17])
What is the iteration variable in the following Python code?
for letter in 'banana' :
print(letter) letter
What does the following Python code print out?
print(len('banana')*7) 42
How would you print out the following variable in all upper case in Python?
greet = 'Hello Bob' print(greet.upper())
Which of the following is not a valid string method in Python? twist() shout()
What will the following Python code print out?
Latest Update
How would you use the index operator [ ] to print out the letter q from the following string?
x = 'From ' print(x[8])
How would you use string slicing [:] to print out 'uct' from the following string?
x = 'From ' print(x[14:17])
What is the iteration variable in the following Python code?
for letter in 'banana' :
print(letter) letter
What does the following Python code print out?
print(len('banana')*7) 42
How would you print out the following variable in all upper case in Python?
greet = 'Hello Bob' print(greet.upper())
Which of the following is not a valid string method in Python? twist() shout()
What will the following Python code print out?