0
Why does this code print ((23+27+18)*2) not work on the "brain freeze" challenge in python core but this code
print ( 23 * 2 + 27 * 2 + 18 * 2 ) does work ? Can somebody tell me please??
3 Antworten
+ 1
I think both works, but the result is not the same,
print((23+21+18)*2)
print( 23 * 2 + 27 * 2 + 18 * 2 )
The second number in the first 'print' statement is 21 while it is 27 for the second. When I checked it the result is like this:
124
136
0
it does seem to print a number. is the number wrong, or is it not printing. if it is not printing maybe remove the space between print and ( do it is like print(...)
0
Both stmts work fine..
print ((23+21+18)*2) #124
print ( 23 * 2 + 27 * 2 + 18 * 2 ) #136
There's no problem in them at all.