1.1. Your First Python Script#
Tip
This is an “In a Nutshell” page. For additional explanation, see the full page here.
1.1.1. Excuting a cell in python#
The print() function in Python is used to output or display text or other information on the screen. It can be used to display a string of text, the value of a variable, or the result of a calculation. The text or information that you want to display is passed as an argument inside the parenthesis of the print() function.
1.1.2. Print () command#
To execute a cell in Python, you can use the run command in Jupyter Notebook or press the “Run” button in the toolbar. You can also use the keyboard shortcut Shift + Enter to execute the cell.
Lets start by excecuting our first code by printing the words ‘Hello world’. Press Shift+Enter to run the cell below. You should see the output “Hello, World!” displayed below the cell. Notice that we have to write the sentence inside the quotation marks to indicate that the data is of string type.
Alternatively, You can also execute the code by clicking on the Run button in the toolbar or by using the run command in the Jupyter Notebook.
print ('Hello, world!')
Hello, world!
Now, try to fill in your name and print the following sentence in the next cell:
print ('My name is _____')
My name is _____