Python Forum
i need help with this simple code
Thread Rating:
  • 3 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
i need help with this simple code
#13
(Oct-18-2016, 07:40 AM)demosthenesk Wrote: Try this
name = "" 
print("What is your name")
input(name)
if name == "Amar" : 
    print("Hi Amar") 
elif name == "Brandy" :
    print("Ahoy Brandy :D")    
else : 
     print("Hello" + name)

Hello! In this way name will always be an empty string because it doens't change its value.
It shoult be:
name = input("What is your name? ")
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply


Messages In This Thread
i need help with this simple code - by josephb401 - Oct-18-2016, 02:33 AM
RE: i need help with this simple code - by nilamo - Oct-18-2016, 02:50 AM
RE: i need help with this simple code - by nilamo - Oct-18-2016, 02:58 AM
RE: i need help with this simple code - by Skaperen - Oct-18-2016, 05:00 AM
RE: i need help with this simple code - by wavic - Oct-18-2016, 10:25 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  First Day using Python. NEED Simple Math CODE HELP! Jesseluke 4 1,458 Jan-13-2023, 01:04 PM
Last Post: jefsummers
  my simple code wont work! help! simon12323121 2 2,069 Sep-05-2021, 09:06 AM
Last Post: naughtyCat
  Can anyone please help with very simple code bee 6 4,982 Sep-29-2017, 02:26 PM
Last Post: ichabod801

Forum Jump:

User Panel Messages

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