We have run through all the necessary set up to take first but small step in python programming to write first python program in Python Anaconda – Jupyter Notebook.
If you still do not have python anaconda installed on your machine, then follow these quick steps to download & install in no time.
I love python Jupyter Notebook interface specially to write tutorials like this. As demonstrated here you could launch. Launch your Jupyter Notebook interface as demonstrated here (using command prompt or python Navigator)
Create your first Notebook with python 3. Click on “New” followed by “Python 3”.
Please note, since we have not changed root location, new file will be created on root level only. If you want to save your program under specific directory, then first you must change your current directory and try to create new program file.
Rename default program name to “My First Program” and click on “Rename”
1. Add Comment
In first cell, add some comment to describe about code functionality. Comments are very important factor in any programming language.
Start your comment text with hash “#”
# First Comment # Print - Hello Anaconda!
Run your first cell, it doesn’t print any output rather cursor moves to next cell.
2. Print “Hello Anaconda!”
To print simple text like “Hello Anaconda!”, python has inbuilt print() function where we have to pass text message to print.
Your code will be auto saved into “My First Program.ipynb” file & file will be located on your current directory.
If you have reached here so far then big Congratulations to you!!
You have successfully completed your first python program. Cheers!!