An integer two-digit number is given.

Input example

79

Sample output

9 7

I do not understand, then you need to work with strings? Simple theme Numbers

Closed due to the fact that off-topic participants 0xdb , gil9red , Enikeyschik , Kromster , aleksandr barakin 30 Nov '18 at 5:08 .

It seems that this question does not correspond to the subject of the site. Those who voted to close it indicated the following reason:

  • " Learning tasks are allowed as questions only on the condition that you tried to solve them yourself before asking a question . Please edit the question and indicate what caused you difficulties in solving the problem. For example, give the code you wrote, trying to solve the problem "- 0xdb, gil9red, enikeyschik, Kromster, aleksandr barakin
If the question can be reformulated according to the rules set out in the certificate , edit it .

  • Add your question to the question ( править button) - it will be easier for you to help with it :) - gil9red
  • one
    Need to see what are the "arithmetic operators" for integers - MBo

2 answers 2

Apparently, something is expected from you like this:

 both = int(input('Введите двухзначное число')) left = both // 10 right = both - (left*10) print('%s %s' % (right, left)) 

I don’t know only whether the integer division can be considered an “arithmetic operator”. But, in which case, it can be replaced by int(both/10)

  • The task does not say that the number should be two-digit. - Enikeyschik Nov.
  • Thanks and on this one) - Andrey
  • This I did not indicate, there is a two-digit current. - Andrey
  • And try instead of using the remainder of the division instead of right = both - (left*10) : right = both % 10 - gil9red
  • @gil9red, I was just not sure whether the finding of the remainder of the division can be attributed to arithmetic operators. Without this restriction, it would be easier to write left, right = divmod (both, 10) at all - Xander
 tens, units = number // 10, number % 10 # The same as divmod(number, 10) print(units, tens)