Question: s1 = 'Practice How to Use String Object' Write a python statement that splits the string, creating the following list : ['Practice', 'How', 'to', 'Use',

s1 = 'Practice How to Use String Object'

Write a python statement that splits the string, creating the following list:

['Practice', 'How', 'to', 'Use', 'String', 'Object']

2.

  1. Assume reply references a string. The following if statement determines whether reply is equal to Y or y:
  2. reply = input("Y or y to continue: ")

    if reply == "Y" and reply == "y":

    print("Y --- has been selected. ")

    else:

    print("y --- has been chosen. ")

    print(" continue running this program ")

  3. Rewrite this statement in python so it only makes one comparison and does not use the or operator. (Hint: use either the upper or lower methods.)

  4. Write a loop that asks the user Do you want to repeat the program or quit? . The loop should repeat until the user has entered an R or Q (either uppercase or lowercase).

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!