Answered step by step
Verified Expert Solution
Question
1 Approved Answer
John is the lab administrator. Write a Python program with if-else structure that performs the following tasks: (1) Ask the user to enter a username.
John is the lab administrator. Write a Python program with if-else structure that performs the following tasks:
- (1) Ask the user to enter a username.
- (2) If the entered username is John, print Hello, administrator!; If the entered name is NOT John, print Hello, XXX! (XXX is the username entered by user, don't forget the '!' at the end of message).
- (3) At the end of the program, print Session end, good bye XXX! (XXX is the name entered by user, don't forget the '!' at the end of message).
Note that: if-else structure must be used (only one keyword if can be used)
The screenshot below contains two test runs: John is entered in the 1st test run; Alice is entered in the 2nd test run.
RESTART: C:\Users\kimxy One Enter your name: John Hello, administrator ! Session end, good bye John ! RESTART: C:\Users\kimxy One Enter your name: Alice Hello, Alice ! Session end, good bye AliceStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started