r/PythonLearning • • Jul 16 '25

Help Request Could it be simpler ?

Post image

I'm totally new to programming in general not only in Python so as according to the advises I received, many people told me to code instead of watching tutorials only and so I did, I made this simple calculator with instructions of course but could it be easier and simpler than this ?

178 Upvotes

61 comments sorted by

View all comments

1

u/[deleted] Jul 17 '25

[removed] — view removed comment

1

u/lilyeatssoup Jul 17 '25 edited Jul 17 '25
while True:
    i = input("> ")
    if all([k in "0123456789.-+*()/" for k in i]):  
        print(eval(i))