Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

reverse number

number = int(input('please enter your number: '))
reverse_num = 0
while number > 0:
    temp = number % 10
    reverse_num = reverse_num * 10 + temp
    number = number // 10
print(reverse_num)
Comment

reverse number

number = input('please enter your number: ')
reverse_num = int(number[::-1])
print(reverse_num)
Comment

how to reverse a number

number = 12345
print(int(str(number)[::-1])) 
Comment

PREVIOUS NEXT
Code Example
Python :: python open application 
Python :: launch application from python 
Python :: pyplot save image 
Python :: using progress bar with rich python 
Python :: unique items in a list python 
Python :: combine two dataframes of same length 
Python :: return render django 
Python :: select specific columns in sqlalchemy 
Python :: python string index 
Python :: create a pandas dataframe 
Python :: python pandas if statement 
Python :: python order list of dictionaries by value 
Python :: readline python 
Python :: list input python 
Python :: bounding box in matplotlib 
Python :: python how to put int into list 
Python :: how to extract digits from a string in python 
Python :: pandas to excel 
Python :: python check for exception 
Python :: list python 
Python :: if it is square python 
Python :: getting url parameters with javascript 
Python :: Count upper case characters in a string 
Python :: python glob how to read all txt files in folder 
Python :: python if loop 
Python :: append vector to vector python 
Python :: naive bayes implementation in python 
Python :: is python idle an ide 
Python :: odd number in python 
Python :: pass multiple arguments to map function python 
ADD CONTENT
Topic
Content
Source link
Name
8+5 =