+ 2
while loop
Would it be correct to say that (in the programming language Python), when a condition is introduced ( while and if for example), further lines of code will be indented by at least 4 spaces?
4 odpowiedzi
+ 5
All Python cares about is indented so:
if True:
print("works")
else:
print("oops")
one space or 20 is all good, just be consistent so that your code doesn't confuse the reader.
+ 3
Thank you all for your answers.
+ 2
https://code.sololearn.com/cqIOz90T6ciK/#py
while True:
print("Yup. Its 4 spaces.")
break
::: OUTPUT ::::
Yup. Its 4 spaces.
+ 1
Use tab, don't be the kind who presses space four times