Answered step by step
Verified Expert Solution
Link Copied!

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.

image text in transcribed

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 Alice

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

Implementing Ai And Machine Learning For Business Optimization

Authors: Robert K Wiley

1st Edition

B0CPQJW72N, 979-8870675855

More Books

Students also viewed these Databases questions

Question

Identify how culture affects appropriate leadership behavior

Answered: 1 week ago