S.Y.I.T Sem 3 Python Practical | Python| Python practical 1d| reverses the user defined value | python for beginner
Hello reader's ,
In this blog you are going to see that how you can reverse a defined value like any number or any name. This blog is for those students who are studying in second year of information technology. This blog is the practical of python subject which is in sem 3.
For performing this practical you must have install python on your laptop or pc. to download python - https://www.python.org/downloads/
python website |
go to the link and download python and you need a IDE which supports python, i am using VS Code, you can use python IDE too.
pycharm |
vs code |
After the successful installation open ide and type the code or simply copy the code from given below and run it to see the output.
Don't forget to leave your comment in the comment section below.
Code -
def reverse_number(number):
reverse = 0
while(number>0):
remainder = number%10
reverse = (reverse*10)+remainder
number = number//10
print("Reverse number is",reverse)
reverse_number(1546)
print(rev('python'))
Comments
Post a Comment
Thank you for sharing this.
You’re helping us become better. Want to stay in the loop? Subscribe to our YouTube channel.