Python Forum
python code tp determin a userName and print message
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
python code tp determin a userName and print message
#1
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.
Reply
#2
Please make an attempt at writing the code, then ask specific questions for help.
Please read: Homework and No Effort Questions
Reply
#3
(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?
Reply
#4
yes. i am learning and the poste question is an exercise i have to research on
please here is sample image of the questions:
       
Reply
#5
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,
Sig:
>>> import this

The UNIX philosophy: "Do one thing, and do it well."

"The danger of computers becoming like humans is not as great as the danger of humans becoming like computers." :~ Konrad Zuse

"Everything should be made as simple as possible, but not simpler." :~ Albert Einstein
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  function-decorator , which is checking an access according to USERNAME Liki 6 612 Feb-17-2024, 03:36 AM
Last Post: deanhystad
  Help! Chatting App - Changing the "IP & Port" into Username Rowan99 0 1,425 Dec-20-2021, 07:02 AM
Last Post: Rowan99
  Creating Email Message Class in Python QuavoJ 1 2,190 Jul-20-2020, 08:30 PM
Last Post: Yoriz
  Password and Username Verification AlwaysNew 4 17,232 Nov-12-2017, 11:51 AM
Last Post: wavic
  Username and password Steve2017 13 9,940 Sep-03-2017, 09:17 PM
Last Post: Steve2017
  Please help me!! Can't get rid of error message in Python. TOM 3 5,179 Nov-01-2016, 04:14 PM
Last Post: micseydel

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020