List
A list is an ordered collection of items. It can be used to store multiple values of different data types. A list is like a collection of items in a basket. It can contain different things, such as numbers, words, or even other lists.
Example 1: A shopping list can contain items of different types like strings, numbers, or booleans.
Python
fruits = [ "apple" , "banana" , "orange" ] print (fruits) |
['apple', 'banana', 'orange']
Let’s understand the List data type with one more example:
Example 2: Imagine you have a list of your favourite colours. You can write them down one after the other.
Python
Colors = [ "red" , "blue" , "green" ] print (Colors) |
['red', 'blue', 'green']
You can easily add or remove colors from your list whenever you want. Lists are like a collection of items that you can change or update easily, just like your list of favorite colors.
Play with List in Python:
- How to create a list in Python
- How to find sum of elements in list
- How to find the Length of a List in Python
- How to swap two elements in a list
- How to add elements to the end of the list
- How to reverse a List in Python
- How to interchange first and last elements in a list
- How to check if element exists in list
- How to find sum and average of List in Python
- How to print positive numbers in a list
- How to print negative numbers in a list
Python for Kids – Fun Tutorial to Learn Python Programming
Python for Kids – Python is an easy-to-understand and good-to-start programming language. In this Python tutorial for kids or beginners, you will learn Python and know why it is a perfect fit for kids to start. Whether the child is interested in building simple games, creating art, or solving puzzles, Python provides the foundation to the kids or any beginner for their coding journey.
Programming is an essential skill in today’s world because programming is used everywhere in our surroundings. And to learn programming, we have to learn a programming language and Python is the best to start with programming language. It has a simple syntax and readability is the best choice for kids to understand programming concepts. In this Python tutorial, you’ll learn all the basic concepts, installation processes, and fundamental programming concepts.
Contact Us