@@ -6,6 +6,9 @@ title: Strings, Integers and Floats
6
6
In this tutorial, we're going to start to work with the basic types of Python:
7
7
strings (for text) and integers & floats (for numeric values).
8
8
9
+ Notice that in this tutorial you are working in REPL (IDLE). You can find more information
10
+ on REPL and how to start Python in your ` cmd ` or ` terminal ` in the [ Installing Python tutorial] ( python/lesson0/tutorial.html ) .
11
+
9
12
## Hello, World!
10
13
11
14
In keeping with tradition, we're going to start by printing "Hello, World!" to
@@ -121,6 +124,30 @@ multiple things at once, separated by a comma:
121
124
122
125
>>> print('The result of 2 + 2 is', 2 + 2)
123
126
127
+ ### Saving Your Work
128
+
129
+ In this tutorial you coded in the REPL (IDLE), but a lot of times you want
130
+ to save your code instead. In such cases you can save your code to a file using a text editor.
131
+ We give some information on text editors in our [ Getting started guide] ( general/setup/tutorial.html ) .
132
+
133
+ Open your text editor and write the code from the first exercise:
134
+
135
+ print("Hello, World!")
136
+
137
+ Save the file as ` ex1.py ` . You can name your files as you like,
138
+ but they should end with ` .py ` , so python can read them easily.
139
+ Reading your file into Python you will use your ` cmd ` or ` terminal ` shell again.
140
+ You can read your file with the following command (type without the $ sign):
141
+
142
+ $ python ex1.py
143
+
144
+ If you have ` >>> ` in front of your code, you are still in REPL(IDLE) and need to exit
145
+ it with:
146
+
147
+ >>> quit()
148
+
149
+ Then you should be able to load the file.
150
+
124
151
This concludes today's tutorial. In the next tutorial, we'll find out how to
125
152
combine the results of multiple separate expressions using variables, get input
126
153
from the user, and make decisions based on that information.
0 commit comments