Being-Creative-with-AI/C3/Lists-and-Dictionaries-in-Python/English

From Script | Spoken-Tutorial
Revision as of 13:49, 15 May 2026 by Misbah (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Visual Cue Narration
Title Slide Welcome to this Spoken Tutorial on Lists and Dictionaries in Python using Colab.
Learning Objectives Slide In this tutorial, we will learn the following -
  • About Lists and Dictionaries
  • Understand how they store data
  • Apply commands to create them
  • Analyze and update their values

Disclaimer Content Slide

As Al tools constantly evolve, if you are unable to locate any icon or encounter difficulty at any step, you may use any conversational Al Chatbot for guidance.
System Requirement Slide To record this tutorial, I am using:
  • A computer with an internet connection.
  • A web browser such as Chrome, Firefox, or Edge.
  • An active Google account to access Google Colab.
Pre-requisite Slide To follow this tutorial, the learner should be familiar with basic computing.
Pre-requisite Slide

For the Pre-requisites of this tutorial, visit the website shown on your screen.

http://EduPyramids.org

For the Pre-requisites of this tutorial, visit the website shown on your screen.
Code Files

The following code file is required to practice this tutorial:

Lists-and-Dictionaries-in-Python.txt

This file is provided in the Code Files link on this tutorial page.

Please download and extract the file.

The following code file is required to practice this tutorial.

This file is provided in the Code Files link of this tutorial page.

Please download and extract the file.

Show Google Colab interface Open any web browser.

In the address bar type, and press enter.

Log into your Google account, when prompted.

Click on New notebook Click on New notebook button on the left corner.

You can run your commands in the code cell.

Show Google Colab interface To add a new code cell, press Ctrl M and B keys.

You can also click on the Plus Code button on the menu bar.

Lists First, let us learn Lists step by step.

A list is a collection of items arranged in order.

We will create a list with three items.

Type features = ["Temperature Control", "Wireless Charging", "Digital Display"] Now pause the video and type the command as shown on the screen.

Press shift and enter keys to run it.

Now we have assigned the list to the variable called features.

Type print(features) In a new code cell, type: print open parenthesis features close parenthesis

Press shift and enter to run it.

You can see the list assigned to the variable features.

Type print(len(features)) To check the number of items type this command:

Press shift and enter to run it.

Output You will see how many items the list has.

Here the output will be three.

Type print(features[0]) Now type: print open parenthesis features square bracket zero close square bracket and then close parenthesis

Press shift and enter to run it.

The output will be the first item that is Temperature Control.

Type features.append("Leak-proof Lid") To add a new item to the list, pause the video and type the command as shown.

Press shift and enter to run it.

Type print(features) To see all the items in the list type: print open parenthesis features close parenthesis

Press shift and enter to run it.

You will see that Leak-proof Lid is added to the previous list.

Dictionary Next, we will learn Dictionaries step by step.

A dictionary is a collection where each item has a key and a value.

Type product_details={"name": "Smart Coffee Mug", "price": 99.99, "in_stock": True} Now let us create a dictionary with keys and values.

Now pause the video and type this command.

Press shift and enter to run it.

Type print(product_details) To display it, type: print open parenthesis product underscore details close parenthesis

Press shift and enter.

You will have the dictionary displayed.

Type print(product_details["price"]) To see only the price, type this command:

Press shift and enter to run the code.

The output will be 99.99

Type product_details["color"] = "Black" Now let us add a new key and value.

Pause the video and type the code as shown on the screen.

Press shift and enter to run the code.

Type print(product_details) To see the updated dictionary, type this command:

print open parenthesis product underscore details close parenthesis

Press shift and enter to run it.

The details of the product are now displayed.

Summary Slide Let us summarize.
  • About Lists and Dictionaries
  • Understand how they store data
  • Apply commands to create them
  • Analyze and update their values
Assignment Slide

Using Google Colab:

  • Create a list of three features
  • Print its length and access the first item
  • Create a dictionary using these features and add a new key
Here is an assignment for you.
Acknowledgement slide This brings us to the end of this tutorial.
Closing slide

This Spoken Tutorial is brought to you by EduPyramids Educational Services Private Limited, SINE, IIT Bombay


Thank you for joining.

Contributors and Content Editors

Misbah