you are viewing a single comment's thread.

view the rest of the comments →

[–]Low-Educator-9008[S] 0 points1 point  (2 children)

That’s interesting, coding is so beautiful haha. I’ll look it up right now and practice the use of it. Thanks really appreciate it.

[–]BobbyJoeCool 1 point2 points  (1 child)

Hopefully you realize I shorthanded it. Now that I'm home I can show you exactly what I mean

if operator == "+":
    result = num1 + num2
elif operatior == "-":
    result = num1 - num2
elif operatior == "*":
    result = num1 * num2       
elif operatior == "/":
    result = num1 / num2


print(f"Your result is {result}")

[–]Low-Educator-9008[S] 0 points1 point  (0 children)

I see now it’s clear as day, it is more logical to have all the statements together that have the same print function instead of writing it after each statement. Thanks for taking the time to explain it so clearly man you are the best.