Posts by Lucas Gabriel • 21 points
1 post
-
2
votes3
answers551
viewsA: if and Else with almost equal blocks
Instead of assigning the value to J and then displaying it, you could do the following: def func(x): print(x/2 if x%2 == 0 else x)
1 post
2
votes3
answers551
viewsInstead of assigning the value to J and then displaying it, you could do the following: def func(x): print(x/2 if x%2 == 0 else x)