My first program
Using the interactive IPython shell alone is exciting only for a while. To write more complex programs, you need to store your instructions in programs, so that you can execute them later.
In this section we will write our first Python program. It is going to simply write a few names of babies to the screen.
Open a text editor (e.g. Spyder) and create a new file. Write into it:
Save the file with the name
Now let's execute our program.
- In Anaconda Spyder you can use the "Play" button or press
In Unix open a terminal, change to the directory with the Python file and type:
Explain the following program:
name = "Emily" jahr = 2000 print(name, jahr)
Write the following program:
name = "Emily" name
What happens when you execute the code?