+ 1
User input + spaces
Hi, the input is like: num1+num2 I need to split input into 3 fragments: 'num1', '+', 'num2'. But if the user input without spaces, Python treats it like one string (so I cant use index). Can I enforce user's input to add the spaces (num1_space_ + _space_ num2? Thank you!
3 odpowiedzi
+ 5
If you're going to use eval(), there's a much simpler way
>>> eval(input())
21*2
42
0
Just A Rather Ridiculously Long Username, superb! Thanks a lot!
0
No problem :)