Python Forum
python code tp determin a userName and print message - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Homework (https://python-forum.io/forum-9.html)
+--- Thread: python code tp determin a userName and print message (/thread-38751.html)



python code tp determin a userName and print message - jackAmin - Nov-19-2022

am new to programming bearly two weeks and have this question below to answer: i need assistance

5-8. Hello Admin: Make a list of five or more usernames, including the name
'admin'. Imagine you are writing code that will print a greeting to each user
after they log in to a website. Loop through the list, and print a greeting to
each user:
• If the username is 'admin', print a special greeting, such as Hello admin,
would you like to see a status report?
• Otherwise, print a generic greeting, such as Hello Jaden, thank you for
logging in again.


RE: python code tp determin a userName and print message - Larz60+ - Nov-19-2022

Please make an attempt at writing the code, then ask specific questions for help.
Please read: Homework and No Effort Questions


RE: python code tp determin a userName and print message - Axel_Erfurt - Nov-19-2022

(Nov-19-2022, 07:59 PM)jackAmin Wrote: ... that will print a greeting to each user
after they log in to a website.

Are you sure you need python for this?


RE: python code tp determin a userName and print message - jackAmin - Nov-19-2022

yes. i am learning and the poste question is an exercise i have to research on
please here is sample image of the questions:
[attachment=2108][attachment=2108]


RE: python code tp determin a userName and print message - rob101 - Nov-20-2022

The code almost writes itself:

Make a list of five or more usernames, including the name 'admin'

What do you think you could use to loop through the list ?

if the username is 'admin',
print() a special greeting
else
print() a generic greeting,