What is the wrong with the following code snippet A Everyone

What is the wrong with the following code snippet?

A) Everyone will get an \"E\"
B) Anyone with a grade higher than 60 will receive a \"D\"
C) Nothing is wrong, students will get the correct grade
D) The code block will not compile

Solution

Ans:

Correct code:

if grade >= 90 :
letterGrade = \"A\"
elif grade >= 80 :
letterGrade = \"B\"
elif grade >= 70 :
letterGrade = \"C\"
elif grade >= 60 :
letterGrade = \"D\"
else :
letterGrade = \"E\"
print(letterGrade)

B) Anyone with a grade higher than 60 will receive a \"D\"
What is the wrong with the following code snippet? A) Everyone will get an \

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site