File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -53,6 +53,28 @@ It's raining!
5353>> >
5454```
5555
56+ But why is that ` if its_raining ` instead of ` if(its_raining) ` ?
57+
58+ Earlier we learned that ` if ` is a ** keyword** .
59+
60+ ``` py
61+ >> > if = 123
62+ File " <stdin>" , line 1
63+ if = 123
64+ ^
65+ SyntaxError : invalid syntax
66+ >> >
67+ ```
68+
69+ Functions like ` print ` need ` () ` after their name to work. But ` if ` is
70+ a keyword, not a function, so it doesn't need ` () ` . Python has separate
71+ functions and keywords because it's possible to create custom functions,
72+ but it's not possible to create custom keywords. That's why keywords are
73+ usually used for "magic" things that would be difficult to do with just
74+ functions.
75+
76+ ## Storing code in files
77+
5678At this point it's easier to put your code into a file and use it
5779there. If you use IDLE, go to File at top left and select New File, or
5880just press Ctrl+N.
You can’t perform that action at this time.
0 commit comments