Python Forum
How to write a code with İF function? - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: How to write a code with İF function? (/thread-30726.html)



How to write a code with İF function? - Aycaaxx - Nov-03-2020

How to create a program that changes the digits of a number that that we enter, so
that the highest digit value becomes the first digit by using if structure. For example, in the four digit number
(abcd) if © is the highest valued digit, then the number will be changed to (cabd).


RE: How to write a code with İF function? - deanhystad - Nov-03-2020

Do you have to use "if"?

For your example, do you mean that 1234 would become 4123 or 4321?

What is your idea for getting hold of the digits in your four digit number? I would start with that part. If you can get the digits the rest is pretty easy.

You should post this under the Homework section.