Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lære Challenge: Weekly Email Summary | Automating Coaching Tasks
Practice
Projects
Quizzes & Challenges
Quizzes
Challenges
/
Python for Coaches

bookChallenge: Weekly Email Summary

Coaches often send weekly summaries to athletes. Automate the creation of personalized, motivational messages.

Opgave

Swipe to start coding

Write a function that takes a list of athlete records and returns a list of personalized summary strings for each athlete.

  • For each athlete, calculate their attendance rate as a percentage using attended_sessions and total_sessions.
  • Generate a summary string including the athlete's name, sessions attended, total sessions, attendance rate (rounded to one decimal place), and a motivational message based on their performance_score.
  • Use the following motivational messages:
    • If performance_score is 90 or higher: "Outstanding performance! Keep setting the bar high."
    • If performance_score is 75 or higher but less than 90: "Great week! Stay focused and keep pushing."
    • If performance_score is 60 or higher but less than 75: "Good effort. A bit more consistency will pay off."
    • If performance_score is less than 60: "Let's work together to boost your performance next week!"
  • Return the list of summary strings.

Løsning

Var alt klart?

Hvordan kan vi forbedre det?

Tak for dine kommentarer!

Sektion 3. Kapitel 3
single

single

Spørg AI

expand

Spørg AI

ChatGPT

Spørg om hvad som helst eller prøv et af de foreslåede spørgsmål for at starte vores chat

Suggested prompts:

Can you show me an example of the kind of summary or message you want to automate?

What information about each athlete should be included in the messages?

How can I make the messages more motivational and personalized?

close

bookChallenge: Weekly Email Summary

Stryg for at vise menuen

Coaches often send weekly summaries to athletes. Automate the creation of personalized, motivational messages.

Opgave

Swipe to start coding

Write a function that takes a list of athlete records and returns a list of personalized summary strings for each athlete.

  • For each athlete, calculate their attendance rate as a percentage using attended_sessions and total_sessions.
  • Generate a summary string including the athlete's name, sessions attended, total sessions, attendance rate (rounded to one decimal place), and a motivational message based on their performance_score.
  • Use the following motivational messages:
    • If performance_score is 90 or higher: "Outstanding performance! Keep setting the bar high."
    • If performance_score is 75 or higher but less than 90: "Great week! Stay focused and keep pushing."
    • If performance_score is 60 or higher but less than 75: "Good effort. A bit more consistency will pay off."
    • If performance_score is less than 60: "Let's work together to boost your performance next week!"
  • Return the list of summary strings.

Løsning

Switch to desktopSkift til skrivebord for at øve i den virkelige verdenFortsæt der, hvor du er, med en af nedenstående muligheder
Var alt klart?

Hvordan kan vi forbedre det?

Tak for dine kommentarer!

Sektion 3. Kapitel 3
single

single

some-alt