0
Need help in python exercise I am stuck thanks
Exercise #1: Step 1: Input user 1's name Step 2: Input user 1's age Step 3: Input user 2's name Step 4: Input user 2's age Expected Result: Print which user is younger and how many years is the gap. 0 age difference should also be handled. Invalid entry should also be validated like non-numeric or float entry for age. After displaying the result, user should be asked Y/N if she wishes to exit. If Y, print "Bye" if N, step 1-4 should be repeated Note: Input should be case insensitive i.e. "y" or "n" should also be accepted.
7 odpowiedzi
+ 7
Michael Reyes You should use if else here .....
+ 2
Can you please show your attempt?
+ 1
Michael Reyes you should go through the python course and learn about some basic concepts like 'if else', 'while' loop and so on.
0
switch case,if...else.
0
I am still a newbie this is what I am typing so far...
variable_name = input("please enter your name: ")
print(User 1 variable_name)
age = input(Please enter your age)
variable_name = input("please enter your name: ")
print(User 2 variable_name)
age = input(Please enter your age)
0
thanks abhay will do just that