You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: python_introduction/README.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -361,7 +361,7 @@ Well... something went wrong here! Python needs to know whether the instruction
361
361
...
362
362
It works!
363
363
364
-
All you need is one space or `TAB`after `...`. To avoid chaos, most Python programmers use four spaces for each level of indentation.
364
+
All you need is one space after `...`. To avoid chaos, most Python programmers use four spaces for each level of indentation.
365
365
366
366
Everything that is indented after the `if` statement will be executed if the condition is met. See:
367
367
@@ -416,7 +416,7 @@ A function is a set of instructions that Python should execute. Each function in
416
416
>>> def hi():
417
417
...
418
418
419
-
As you can see, there are those dots again! This means that nothing has really happened yet... and yes, we need to press the `TAB` key before giving our instructions:
419
+
As you can see, there are those dots again! This means that nothing has really happened yet... and yes, we need to press the `Space` key before giving our instructions:
420
420
421
421
>>> def hi():
422
422
... print('Hi there!')
@@ -447,7 +447,7 @@ As you can see, we now gave our function a parameter that we called `name`:
447
447
... print('Hi anonymous!')
448
448
...
449
449
450
-
As you can see, we needed to put two tabs before the `print` function, because `if` needs to know what should happen when the condition is met. Let's see how it works now:
450
+
As you can see, we needed to put two spaces before the `print` function, because `if` needs to know what should happen when the condition is met. Let's see how it works now:
451
451
452
452
>>> hi("Ola")
453
453
Hi Ola!
@@ -486,7 +486,7 @@ We want to greet all of them by their name. We have the `hi` function to do that
486
486
>>> for name in girls:
487
487
...
488
488
489
-
Dots again! Remember what goes after the dots? Yes, a tab :)
489
+
Dots again! Remember what goes after the dots? Yes, a space :)
490
490
491
491
>>> for name in girls:
492
492
... hi(name)
@@ -503,7 +503,7 @@ Dots again! Remember what goes after the dots? Yes, a tab :)
503
503
Hi You!
504
504
Next girl
505
505
506
-
As you can see, everything you will put inside a `for` statement with `TAB` will be repeated for every element of the list `girls`.
506
+
As you can see, everything you will put inside a `for` statement with space will be repeated for every element of the list `girls`.
507
507
508
508
You can also use `for` on numbers using the `range` method:
0 commit comments