Ok, you installed python from www.python.org
The version 3.5 is good.
Now open the window console (as I will speak about the windows version version, even if python works in almost the same way in linux and MacOs systems).
To open the command line, click on the windows button + r, then write cmd and you are done.
After that write python and you will see that you are ready to start.
The console will show you some informations about the version of python.
>>> print("Hello World")
Then click enter and you will see your first program appear.
After that you printed to the console the number.
The version 3.5 is good.
Now open the window console (as I will speak about the windows version version, even if python works in almost the same way in linux and MacOs systems).
To open the command line, click on the windows button + r, then write cmd and you are done.
After that write python and you will see that you are ready to start.
The console will show you some informations about the version of python.
First program
write this:>>> print("Hello World")
Then click enter and you will see your first program appear.
You second program
Let's make another program>>> a = 1 >>> print(a) 1In this one you created a variable called a and you gave a numeric value (1).
After that you printed to the console the number.
Let's write on a file
You can easily put your values in a file instead of using the console to display your data.>>>with open("newfile.txt","w") as file: ... a = 1 ... file.write(a) ...Ok, after you clicked enter a couple of time, go check in the directory where you are to find the new file you created with the number 1 in it. Great Stuff.
Comments
Post a Comment