Normalize Score to 0..100
Python
Medium
5 views
Problem Description
You will receive integer score. If score is below 0 set to 0, if above 100 set to 100. Output final value.
Input Format
One integer score.
Output Format
One integer normalized.
Official Solution
import sys
s=sys.stdin.read().strip()
if not s: sys.exit(0)
x=int(s)
if x<0: x=0
elif x>100: x=100
sys.stdout.write(str(x))
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!