r/PythonLearning • u/gyrojoestar31 • Sep 17 '26
Help Request any clue how to do this?
im on my first year of learning python in school is this even possible??
25
Upvotes
r/PythonLearning • u/gyrojoestar31 • Sep 17 '26
im on my first year of learning python in school is this even possible??
View all comments
Show parent comment
0
u/csabinho Sep 17 '26
You mean "they have mentioned to NOT use if/else", right? And yep. My fault. I'd use conditional statements with the walrus operator instead. Like
(operator == "-" and (result := first_number-second_number)).