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
#11
the "opportunity" requires python?
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#12
(Oct-18-2016, 02:33 AM)josephb40 Wrote: I don't know what is wrong with this code can someone fix it for me or help me fix it?

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)
Reply
#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


Possibly Related Threads…
Thread Author Replies Views Last Post
  First Day using Python. NEED Simple Math CODE HELP! Jesseluke 4 1,362 Jan-13-2023, 01:04 PM
Last Post: jefsummers
  my simple code wont work! help! simon12323121 2 2,018 Sep-05-2021, 09:06 AM
Last Post: naughtyCat
  Can anyone please help with very simple code bee 6 4,873 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