answersLogoWhite

0


Want this question answered?

Be notified when an answer is posted

Add your answer:

Earn +20 pts
Q: How do you write a program in python to write the reverse of a number?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How to write a program in python to print the reverse of a number?

In python, type the following into a document. NOTE: Sentences following a # symbol are comments, and are not necessary for the program to run. #!/usr/bin/python #This program takes a input from a user and reverses it. number = input("Type a number: ") #This takes input from a user. a = len(number) #This finds the length of the number reverse = "" #This sets the variable reverse to an empty string. for i in number: a = a-1 #The places in a string start from 0. The last value will be the length minus 1.reverse = reverse + number[a] #Makes the number's last digit the new string's first. print("The reverse of", number, "is", reverse + ".") #prints the resulting string. This program will take any sequence of characters and reverse them. The final value is a string, but if an integer is needed, one needs only to add the line reverse = int(reverse) above the print statement. However, this will stop the program from being able to reverse strings, as it is not possible to convert a string to an integer if it is not a number.


How do you Write a C program to reverse an Integer number.?

Reference:cprogramming-bd.com/c_page2.aspx# reverse number


How do you write a program that outputs a given characters in reverse?

write the javascript code to display the reverse no. of given no. (e.g. 247 reverse of 742)


How do you make a program in python using do while loop to display the multiplication table of number from one to ten?

a = 0while a < 10 :a += 1print (a)Write the above simple script in a text editor (I use nano). Save as loop.py in home folder. To run, open a terminal and at the prompt, write: python loop.pyResult:rodney@downstairs:~$ python loop.py12345678910


How you write a program in c plus plus to print plaindromic numbers from 1 to n?

To check if a number is a palindrome, reverse the number and see if it is equal to the original number. If so, the number is a palindrome, otherwise it is not. To reverse a number, use the following function: int reverse(int num, int base=10) { int reverse=0; while( num ) { reverse*=base; reverse+=num%base; num/=base; } return(reverse); }


Write a program to read your name and reverse it using arrays?

abdulrahman


Write the program in Linux to find the reverse of any string?

i am sam


How do you write a horoscope program on python?

Hi gys, are you looking to write a program to know the sign depends on the birth date or horoscope on python? write down following codes on python, those will make a nice program. #This program will get the horoscope sign. def getSign(): name = raw_input ("Enter Your Name: ") month = raw_input("Enter Birth Month: ") day = int(raw_input("Enter Birth Day of Month: ")) if month "y": main() letter = raw_input("Go again? (y/n): ")


How do you Write a program in 'c' language which accepts int numbers from the users print its reverse number x function which return value?

question clarity


How do you write a program to input radius of a circle and calculate the area or circumferences of the cirlce?

In which computer language?


Write a program to convert a 2 digit BCD number into hexadecimal number?

Write a program to convert a 2-digit BCD number into hexadecimal


Write a c program on reverse the diagonal element of matrix?

mano ni anda yarrr