Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
If/Else Statement Help!
#1
Hello
I am teaching myself python so sorry for the silly question. I wrote something very simple. If Joe calls, say "Hi Joe." If someone else calls say "How may I help?". Every time I will get back Hi, Joe regardless of the input. Can someone tell me what I am doing wrong? I am using Azure Notebooks:

friend = "Joe"
call = input("Who is this?")
if friend:
    print("Hi, Joe.")

else:
    print("How may I help?")

Ok dumb question. I forgot to insert

if call == friend
Reply


Messages In This Thread
If/Else Statement Help! - by Dizzy215 - Apr-27-2018, 06:10 PM
RE: If/Else Statement Help! - by j.crater - Apr-27-2018, 06:40 PM

Forum Jump:

User Panel Messages

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