Skip to content

Instantly share code, notes, and snippets.

@ayubmetah
Created January 19, 2021 03:41
Show Gist options
  • Select an option

  • Save ayubmetah/090a326954e3ef1b36870170e378537d to your computer and use it in GitHub Desktop.

Select an option

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.

@Abaioni
Copy link

Abaioni commented May 27, 2025

This is great I tried multiplwe times but kept using print rather thn return

@Kerniol1
Copy link

Je cherchais quelque chose pour passer un peu de temps après mes cours, rien de spécial. J’ai trouvé le site https://royaltiger.fr, il m’a semblé simple et facile à comprendre. Le site propose beaucoup de bonus pour les joueurs en France, avec des promotions régulières et des offres qui changent souvent, ça donne envie de rester plus longtemps et essayer différents jeux, surtout avec les tours gratuits et les bonus dépôt qui arrivent vite et font plaisir aux gens qui jouent parfois juste pour se détendre.

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