Python Forum
help! if statement not working
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
help! if statement not working
#1
so i need to write a code that will do the following
#ask for name
#ask for health score
#ask for grade
#ask for economic output
#if the grade is A OR economic output is above 85 print they meet the criteria
#if the health score and economic output are both over 60 and grade is at least a C print congratulations
#otherwise print sorry

I have written the below but it doesnt work. It doesnt print the correct statements at the end.
can someone show me where i am going wrong please.



name = raw_input("Enter your name:")

health = raw_input("Enter your standardised health score:")

grade = raw_input("Enter your standardised grade:")

economic = raw_input("Enter your standardised economic output score:")

if grade == "A" or economic >85:
print name, "you meet the exceptional criteria."
elif health and economic >60 and grade >= "C":
print "Congratualtions", name, "you have been selected."
else:
print "Sorry", name, "you are not permitted to board the ship."
Reply


Messages In This Thread
help! if statement not working - by molliemae - Apr-26-2018, 09:50 PM
RE: help! if statement not working - by j.crater - Apr-26-2018, 10:29 PM
RE: help! if statement not working - by woooee - Apr-26-2018, 11:13 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  if statement not working g0g0g1g 2 1,626 Sep-08-2020, 05:40 PM
Last Post: nilamo
  Else Statement Not Working SenkouSimmer 4 3,216 Jul-22-2019, 11:42 AM
Last Post: jefsummers
  Simple IF statement not working as intended gortexxx 2 2,770 May-17-2018, 07:54 PM
Last Post: gortexxx

Forum Jump:

User Panel Messages

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