Issue
So let's say I have something like this:
while True:
if x == x: print("x is equal to itself!")
else:
print("something's not right")
break
Is there a way to condense that else statement into a single line similar to the if statement?
Solution
This will work for you:
while True:
if x == x: print("x is equal to itself!")
else: print("something's not right"); break
Also if x ALWAYS equals x the "Else" statement will never be used.
Answered By - CasualGamer
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.