Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lära Challenge: Simulate Sending Notifications | Automating Classroom Tasks
Practice
Projects
Quizzes & Challenges
Quizzes
Challenges
/
Python for Teachers

bookChallenge: Simulate Sending Notifications

Teachers often need to notify students about their performance. In this challenge, you'll generate personalized messages for students based on their grades.

Uppgift

Swipe to start coding

Write a Python script that loops through a dictionary of student grades and prints a customized notification for each student.

  • Loop through each student and their grade in the student_grades dictionary.
  • If the grade is 90 or above, print the exact message: Congratulations {student}, you scored {grade}! Excellent work!
  • If the grade is between 70 and 89 inclusive, print the exact message: Good job {student}, you scored {grade}. Keep it up!
  • If the grade is below 70, print the exact message: {student}, you scored {grade}. Let's work together to improve your performance.
  • Use string formatting to include the student's name and grade in each message so that the output matches the examples above.
  • Print the appropriate message for each student.

Lösning

Var allt tydligt?

Hur kan vi förbättra det?

Tack för dina kommentarer!

Avsnitt 3. Kapitel 7
single

single

Fråga AI

expand

Fråga AI

ChatGPT

Fråga vad du vill eller prova någon av de föreslagna frågorna för att starta vårt samtal

Suggested prompts:

Can you show me an example of the personalized message format?

What are the grade ranges and corresponding messages?

How should I input the students' grades?

close

bookChallenge: Simulate Sending Notifications

Svep för att visa menyn

Teachers often need to notify students about their performance. In this challenge, you'll generate personalized messages for students based on their grades.

Uppgift

Swipe to start coding

Write a Python script that loops through a dictionary of student grades and prints a customized notification for each student.

  • Loop through each student and their grade in the student_grades dictionary.
  • If the grade is 90 or above, print the exact message: Congratulations {student}, you scored {grade}! Excellent work!
  • If the grade is between 70 and 89 inclusive, print the exact message: Good job {student}, you scored {grade}. Keep it up!
  • If the grade is below 70, print the exact message: {student}, you scored {grade}. Let's work together to improve your performance.
  • Use string formatting to include the student's name and grade in each message so that the output matches the examples above.
  • Print the appropriate message for each student.

Lösning

Switch to desktopByt till skrivbordet för praktisk övningFortsätt där du är med ett av alternativen nedan
Var allt tydligt?

Hur kan vi förbättra det?

Tack för dina kommentarer!

Avsnitt 3. Kapitel 7
single

single

some-alt