Given name = 'Grace' and score = 97, use an f-string to print 'Grace scored 97 (perfect)' when score
A medium Python interview practice problem on DataDriven. Write and execute real python code with instant grading.
- Domain
- Python
- Difficulty
- medium
Problem
Given name = 'Grace' and score = 97, use an f-string to print 'Grace scored 97 (perfect)' when score >= 95, otherwise 'Grace scored 97'. Use a conditional expression inside the f-string or around it.
Practice This Problem
Solve this Python problem with real code execution. DataDriven runs your Python code in a real environment and grades it automatically.