Question #66545

You have a unique ID number, which is represented by the variable id, containing a string of numbers. Write a program that continuously takes strings to standard input. If the string is not your ID number, print "This is not your ID number." If it is, print "This is your ID number: " followed by the number, and terminate the loop.
1

Expert's answer

2017-04-04T01:47:07-0400

Answer on question #66545- Programming & Computer Science / Python


id = "12345"
while True:
    s = input().strip()
    if s == id:
        print("This is your ID number: " + s)
        break
    print("This is not your ID number.")


Answer provided by www.AssignmentExpert.com

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!
LATEST TUTORIALS
APPROVED BY CLIENTS