Write a function reverse() that accepts a nonnegative integer argument n and returns the integer that has the reverse decimal re
presentation. For example, the reverse of 12 is 21, and the reverse of both 21 and 210 is 12. Your function should also be placed in decimal.py
1 answer:
Answer:
the code is attached.
Explanation:
- First check the parameter and if it is negative, print "please enter a nonnegative integer"
- then using str(), convert the parameter into string
- using slice operation [::-1] reverse the string
- return it as an integer using int()
You might be interested in
Answer: In alphabetical or it can be also arranged by file size, last updated and when created.
Explanation:
Answer:
a language that computers use
Explanation:
Coding can come in many different forms but it is all used on the computer and then translated.
Ammonia Wipes is the answer glad i could help :)
Answer:
maybe select an instrument