by CodeChum Admin
This one is a bit tricky. You're going to have to isolate each digit of the integer to determine which one is the largest, so good luck!
Instructions:
Instructions
Input
A line containing a three-digit integer.
173
Output
A line containing a single-digit integer
7
number=int(input())
largestDigit=0
while number>0:
digit=number%10
if largestDigit<digit:
largestDigit=digit
number=number//10
print(largestDigit)
Comments
Leave a comment