Skip to content

Instantly share code, notes, and snippets.

@ayubmetah
Created January 19, 2021 03:41
Show Gist options
  • Save ayubmetah/090a326954e3ef1b36870170e378537d to your computer and use it in GitHub Desktop.
Save ayubmetah/090a326954e3ef1b36870170e378537d to your computer and use it in GitHub Desktop.
Modify the student_grade function using the format method, so that it returns the phrase "X received Y% on the exam". For example, student_grade("Reed", 80) should return "Reed received 80% on the exam".
def student_grade(name, grade):
# return ""
return "{} received {}% on the exam".format(name, grade)
print(student_grade("Reed", 80))
print(student_grade("Paige", 92))
print(student_grade("Jesse", 85))
Copy link

ghost commented Sep 10, 2021

that's great. thank you, it helped me a lot to check whether i also written this code right or wrong.

@Whoste
Copy link

Whoste commented Aug 30, 2022

Thanks for the piece of code, I did a project in college and used it. I was uploading essays for students from https://writix.com/essay-examples/law and using this code to mark who had what work. It came out pretty good and I think we can do it again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment