Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The following if statement determines whether reply is equal to Y or y : reply = input(Y or y to continue: ) if reply ==

The following if statement determines whether reply is equal to Y or y:

  1. 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 ")

  2. 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.)

  3. 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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database Management Systems

Authors: Mark L. Gillenson

2nd Edition

0470624701, 978-0470624708

More Books

Students also viewed these Databases questions