- Open your web browser and go to Google Colab.
- # to your Google account if you are not already signed in.
- Create a New Notebook:
- On the Colab homepage, click on "File" in the top-left menu.
- Select "New notebook" from the dropdown menu.
- A new notebook will open with an empty code cell.
- Write Python Code:
- In the first cell, type the following Python code:
print("Hello, World!")
- In the first cell, type the following Python code:
- Run the Code:
- Click on the cell to select it.
- Press
Shift + Enter
to run the cell. - You should see the output "Hello, World!" below the cell.
-
Add a New Cell:
- Click on the "+" button in the toolbar to add a new cell below the current one.
-
Change Cell Type to Markdown:
- With the new cell selected, click on the dropdown menu in the toolbar that says "Code" and change it to "Text".
-
Write Text:
- In the new markdown cell, type the following:
# My First Google Colab Notebook This notebook contains a simple Python script that prints "Hello, World!".
- In the new markdown cell, type the following:
-
Render the Markdown Cell:
- Press
Shift + Enter
to render the markdown cell. The text will be formatted as a heading and a paragraph.
- Press
- Save the Notebook:
- Click on "File" in the menu and select "Save" or "Save a copy in Drive".
- If you choose "Save a copy in Drive", a copy of the notebook will be saved to your Google Drive.
Your final notebook should look like this:
-
Markdown Cell:
# My First Google Colab Notebook This notebook contains a simple Python script that prints "Hello, World!".
-
Code Cell:
print("Hello, World!")
-
Output:
Hello, World!
You have now created, edited, run, and saved a simple notebook in Google Colab.
Please create an Issue for any improvements, suggestions or errors in the content.
You can also contact me using Linkedin for any other queries or feedback.