Learning Python: More on for loops - Deepstash
Learning Python: More on for loops

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

4

26 reads

MORE IDEAS ON THIS

CURATED FROM

CURATED BY

samuelbancroft

Keep reading, keep studying, the more you learn the more you change. If you are doing the Python lessons please join this discord channel https://discord.gg/kugXx9KY but please follow the rules

More like this

Learning Python: Basic Mathematical Operators error

Learning Python: Basic Mathematical Operators error

So as you can see from the image we are using 2 variables, x and y. Like in the previous lessons explained about variables, x contains the string Hello World, what makes it a string is " " the use of these quotation marks. Next in y there is a integer value 10. Then i am adding them both together...

Learning Python: More on printing and variables

Learning Python: More on printing and variables

In this part we will be going over more on variables and printing them.

So let's make a variable and give it the value of 10, so it should look something like this X = 10, X could be any word really just not a reserved word, here is a link to a website with alot of reserved words that can't...

Learning Python: IF statements

Learning Python: IF statements

As you can see in the image, we are working with conditional if statements. This is used to find out if something is True or False. As you can see i used '

Read & Learn

20x Faster

without
deepstash

with
deepstash

with

deepstash

Access to 200,000+ ideas

Access to the mobile app

Unlimited idea saving & library

Unlimited history

Unlimited listening to ideas

Downloading & offline access

Personalized recommendations

Supercharge your mind with one idea per day

Enter your email and spend 1 minute every day to learn something new.

Email

I agree to receive email updates