- I changed the inequality check to work
- casted score to
int
so that it can be used in arithmetic
- changed some syntax to work correctly
print("Exam Grade Calculator")
nameOfExam = input("What is the name of your exam?")
print("The maximum possible score for this exam was 50.")
score = int(input("What score did you recieve in your", nameOfExam, "? "))
percentage = (score/50)*100
if percentage >= 90:
print("Fab, you got an A+!")
else:
print("Boo sucks to you:(")
2 Likes
Hi, I’ve changed my code to look like yours, but when running it it says
Traceback (most recent call last):
File "main.py", line 4, in <module>
score = int(input("What score did you recieve in your", nameOfExam, "? "))
TypeError: input expected at most 1 argument, got 3
I have completed 100 days of code and here it is day 13 I have solved it
https://replit.com/@arhanansari2009/EXAM-GRADE-CALCULATOR?v=1
int(input("What score did you recieve in your " + nameOfExam + "? "))
2 Likes
Hey @anannaislam,
Welcome To The Replit Ask,
In Your 13 Of 100 Days Of Code Challenge You’re Facing Error You Have Error In Your Score Input (Score Input Returning Value As String Not Integer And You Passing Three Argument’s In Input So You Need To Use f-String) And If Statement (In If Statement >
Sign Is After =
Sign), So Here Is Your Solution :
Score Variable Solution :-
score = int(input(f"What score did you recieve in your {nameOfExam} ?"))
If Statement Solution :-
if percentage >= float("90"):
Solution :-
print("Exam Grade Calculator")
nameOfExam = input("What is the name of your exam?")
print("The maximum possible score for this exam was 50.")
score = int(input(f"What score did you recieve in your {nameOfExam} ?"))
percentage = (score/50)*100
if percentage >= round(float("90"),2):
print("Fab, you got an A+!")
else:
print("Boo sucks to you:(")```
2 Likes