0

Can someone help me with this grade score programme. Im new to the programming world

i want user to input his grade as letter instead of an integer. The grade is from A to F if user inputs a or A to C , they get a prompt saying well done in any other case they fail

18th Apr 2017, 3:40 PM
Kudzai Machakanja
Kudzai Machakanja - avatar
13 Answers
+ 4
Do the Python course. You will learn everything you need for this problem in the beginning of the second module and that way you have a first little practice project.
18th Apr 2017, 3:45 PM
Tob
Tob - avatar
0
as Tobi said, we are here to help, not do.. Feel free to show us code your working on and we can give pointers and help with errors
18th Apr 2017, 4:00 PM
LordHill
LordHill - avatar
0
https://code.sololearn.com/cnqm1Mt3W9LZ/?ref=app this is the programme I've done the issue im struggling with is the grade bit. when user inputs a letter i keep getting "grade is not defined" in the programme the user has to me two conditions. the first conditions is grade = a, health score= >=60 and economic_output= >=60. if he meets this condition he gets a prompt saying congratulations. the second condition is grade =a:c and economic_output= >=85 . if user meets this criteria he gets a prompt saying "you've met the exceptional criteria" in any other case they get a prompt saying "no"
18th Apr 2017, 4:14 PM
Kudzai Machakanja
Kudzai Machakanja - avatar
0
my lunch break is over, but I fixed what I saw. appears your working python 2.. sololearn uses python 3. couple things to watch for. raw_input should just be input. print "" should be print("") .. variables can't have spaces. economic output change to ecenomicOutput health = 0 health in range (0,100) economicOutput= 0 economicOutput in range (0,100) grade = ["A","B","C","D","E","F"] inname= input ("enter your name: ") name = str(inname [0]).upper()+ inname [1:] economicOutput =int(input ("enter your economic output: ")) health = int(input ("enter your health: ")) grade = input ("enter your grade ") if grade=="A" and health >=60 and economicOutput >=60: print("congratulations,"+name+"you been selected") elif grade =="A" and economicOutput >85: print(inname +",you have met the excepetional criteria") else: print("you didnt meet the criteria ")
18th Apr 2017, 4:22 PM
LordHill
LordHill - avatar
0
@one pride now when i input any letter it keeps writing "you didn't meet the criteria" how do i fix that
18th Apr 2017, 4:46 PM
Kudzai Machakanja
Kudzai Machakanja - avatar
0
it worked when I ran it.. are you using A or a?
18th Apr 2017, 5:02 PM
LordHill
LordHill - avatar
0
@dirty Joe now the issue is whatever letter you put as a grade you get a prompt "congratulations". you should only get that if your grade = "a" , health= >=60 and economicOutput=>=60
24th Apr 2017, 2:32 PM
Kudzai Machakanja
Kudzai Machakanja - avatar
0
can i see the code you currently have?
24th Apr 2017, 2:36 PM
LordHill
LordHill - avatar
24th Apr 2017, 2:38 PM
Kudzai Machakanja
Kudzai Machakanja - avatar
0
You seem to still be using Python 2.. with my changes to Python 3 it seems to be working fine. https://code.sololearn.com/cRAbBqtI7dol/?ref=app
24th Apr 2017, 3:34 PM
LordHill
LordHill - avatar
0
the second condition if user inputs a,b,c they shud get the the second prompt and if they input d to F they get the prompt under else
24th Apr 2017, 4:55 PM
Kudzai Machakanja
Kudzai Machakanja - avatar
0
your code still suffers from the origional problems for sololearn playground. your coding python 2 in a python 3 enviroment. input() not raw_input() spaces in variable names also unacceptable print("") not print ""
24th Apr 2017, 5:24 PM
LordHill
LordHill - avatar
0
@Dirty Joe the second condition isn't "a" but it's greater than "c". how do I implement this
27th Apr 2017, 1:09 PM
Kudzai Machakanja
Kudzai Machakanja - avatar