#๐Ÿ”’ 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
#

i want code for this one with its explanation

cold salmonBOT
#

@stray zealot

Python help channel opened

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.

echo dock
#

what have you tried so far?

stray zealot
#

i havent tried yet, ive no idea about this reverse form

viral delta
#

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

stray zealot
#

ohhkk then ill try and i wiil ask

viral delta
#

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

stray zealot
crisp sail
# stray zealot yeah i have but its quite confusiing
crisp sail
#

Np.

stray zealot
#

num = 123456
print(str(num)[::-1])

#

may i get explanation for this code

sudden oasis
#

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

torpid raven
#

!eval

num = 123456
print(str(num)[::-1])
cold salmonBOT
torpid raven
#

here you go

cold salmonBOT
#
Python help channel closed

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.