Learning Python - Deepstash

💻

Learning Python

18 STASHED IDEAS

Learning Python: Lists

Now we are getting to the fun stuff. 

We can think of a list as a variable that can contain more than one variable, and they can all be different data types.

As you can see by the image we define a list the same way as a variable, in this case "My_List =" after the equal we need to use square brackets "[ ]".

In this lesson we will just print the lists, which is just "print(My_List)", this wil print the list in to the console as you can see.

In the next lesson we will look at how to manipulate the lists.

Dont forget to join the discord channle if you need any help

4 STASHED

2 LIKES

Python: Part Twelve

🚶 On a walk

Learning Python: More on for loops

Just like last week i have created a for loop, but instead of only one number in the brackets.

The first number is the starting value and the second value is the highest, so in this case i have put 10, 100 so the range is 10 to 99, the last number which i put as 5, is the steps, so every 5 numbers it will do what is in the for loop. This could be any number range, plus it can go the other way aswell, so when you make the for loop in the pair of brackets put 100, 0 , -1 and it will count down instead.

For loops can also be used to iterate through lists, but that is the next lesson

Join discord

3 STASHED

1 LIKE

Python: Part Eleven

🚶 On a walk