Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help with my first program
#2
What is printed should be on the screen/terminal to read it. 

Once you check for an answer don't need to do it again in the same if block.

if HP == 'Yes':
 
   print ("This is a Repeater project")
   raise SystemExit
You can use str.lower() to convert the answer to lowercase and check for 'yes'. The way how it is right now if one enter 'yes' instead of 'Yes' the if condition will be False.

if HP.lower() == 'yes':
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply


Messages In This Thread
Help with my first program - by CadWizard - Feb-21-2017, 09:10 PM
RE: Help with my first program - by wavic - Feb-21-2017, 10:08 PM
RE: Help with my first program - by ichabod801 - Feb-21-2017, 11:50 PM
RE: Help with my first program - by CadWizard - Feb-22-2017, 08:48 AM

Forum Jump:

User Panel Messages

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