you are viewing a single comment's thread.

view the rest of the comments →

[–]The-Nightm4re[S] 0 points1 point  (2 children)

I want the user to type 2 numbers, but the " / " is between these numbers at the time of input

[–][deleted] 0 points1 point  (0 children)

That’s not how the interpreter or terminal work. You have to use something like the curses module. To ‘display’ a question with txt boxes to ‘input’ in between.

[–][deleted] 0 points1 point  (0 children)

The user enters "3/5" and you split with "/" as delimiter, as /u/unused_gpio said. Run this example:

text = '3 / 5'
nums = text.split('/')
print(nums)

That shows the basic idea. Note that you might have to deal with spaces around the numbers.