Python Forum
Trying to create a conditional with a username
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Trying to create a conditional with a username
#1
hi guys ~

i need help trying to code a name question but im trying to repeat the "enter your name" if the user just press enter without type nothing


print('Welcome')

user_name = (input('Please enter your name:'))

if user_name  == input(''):
    print(f'Hi {user_name}! im here to help you')
else: 
    print('Please enter a name')
thanks for the help
Reply


Messages In This Thread
Trying to create a conditional with a username - by Realen - Jun-19-2020, 11:49 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  AttributeError: '_tkinter.tkapp' object has no attribute 'username' Konstantin23 4 1,875 Aug-04-2023, 12:41 PM
Last Post: Konstantin23
  Hiding username and password on sql tantony 10 3,056 Oct-21-2022, 07:58 PM
Last Post: wavic
  Pulling username from Tuple pajd 21 3,636 Oct-07-2022, 01:33 PM
Last Post: pajd
  Client OS username ImPyBoy17 5 2,758 Sep-24-2019, 10:18 AM
Last Post: buran
  creating a username and pword program using a #def statement and #dictionary zcode12 3 3,195 Oct-14-2018, 04:41 AM
Last Post: volcano63

Forum Jump:

User Panel Messages

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