#๐ Write a Python program to get four digit number from the user and print its reverseform.
22 messages ยท Page 1 of 1 (latest)
@stray zealot
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
what have you tried so far?
i havent tried yet, ive no idea about this reverse form
I'm sorry but you can't just ask to write a program to you out of the blue.
This server isn't about programming for someone and sending them the code so they can copy paste
ohhkk then ill try and i wiil ask
Have you not tried to google the solution?
Alright
If you can't do it or there's an error or there is another question you have based on your code and your tries then ask right here and we are going to answer and help freely
yeah i have but its quite confusiing
https://www.programiz.com/python-programming/examples/reverse-a-number
https://www.geeksforgeeks.org/python-program-to-reverse-a-number/
Little bit of google didnt hurt anybody.
In this example, you will learn to reverse a number.
A Computer Science portal for geeks. It contains well written, well thought and well explained computer science and programming articles, quizzes and practice/competitive programming/company interview Questions.
thank you so much
Np.
num = 123456
declares the num variable as a number 123456 (with integer type)
str(num) turns the int into a string as "123456"
and [::-1] is the string slicing to reverse a string
!eval
num = 123456
print(str(num)[::-1])
:white_check_mark: Your 3.12 eval job has completed with return code 0.
654321
here you go
This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.