0

Please help me in finding the mistake.

# Reverse a number in python Number = int(input(" ") ) print("\n Entered Number = %d" %Number) Reverse = Null while(Number > Reverse ): Reminder = Number %10 Reverse = (Reverse *10) + Reminder Number = Number //10 if(%Number == %Reverse) print("Palindrome number") else print("\n Reverse of entered number = %d" %Reverse)

29th Jun 2017, 8:30 AM
Guna Tanesh
Guna Tanesh - avatar
1 Respuesta
+ 2
- you need colon after if condition - you don't need paranthesis in if condition and while loop - you don't need that percent sign in the last if confdition - equivalent null in python is "None" (this is case-sensitive) these are only the syntax mistakes but i didn't undestand what you want to do exactly... edit: it seems to work if you initialize "Reverse" as 0. Reverse can't be None because in that case while loop doesn't know how to solve his condition...
29th Jun 2017, 9:03 AM
2_3rr0r5
2_3rr0r5 - avatar