For Loop in Python (So Easy to Understand) #9

For Loop in Python (So Easy to Understand) #9

Programiz

3 года назад

160,365 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Liyanage Chamikara
Liyanage Chamikara - 14.10.2023 22:45

sum=0
for count in range(1, 101):
sum = sum + count
print(sum)

Ответить
Yashwantha Gowda S
Yashwantha Gowda S - 04.10.2023 10:58

sum=0
for i in range(1,101):
sum=sum+i
if i==100:
print('Sum:',sum)

Ответить
Rana Tej S. R
Rana Tej S. R - 13.09.2023 15:04

Fact = 5
For i in range (4) :
Fact = ( fact * i )
Print ( fact )

Answer me sir i don't understand this problem sir

Ответить
Veer Rahul Gupta
Veer Rahul Gupta - 22.08.2023 18:17

For anyone watching this video in 2023 (soon to be 2024):

Here is the homework answer if you want it :> :

number = 0

for number in range(0,100):
number = number+1
print(number)

Explanation :

So we will always start from 0 to obtain the next number. And as explained in the video, we take the range as well. So after that since we gave our beginning value of number '0', '0' + 1 = 1. And this will continue till the range is satisfied. This is the magic of for loop!

If somebody didnt understand, I am so sorry. Maybe I shouldnt be a teacher 😃

Ответить
Edniel PIERRE
Edniel PIERRE - 14.07.2023 12:03

Thanks to you

Ответить
Mathumitha
Mathumitha - 27.06.2023 08:40

number=0
for number in range(0,100):
value=number+1
print(value,"+")

Ответить
Lakshan J. Kumara
Lakshan J. Kumara - 21.05.2023 16:00

sum=0

for i in range(1,101):
sum=sum+i
print(sum)

Ответить
Ruona Azigbo
Ruona Azigbo - 13.05.2023 07:07

First issue was understanding the word "iterate" lol

Ответить
Iryna Hryma
Iryna Hryma - 04.04.2023 19:10

Thank you for your lessons! You 're explaining really very good. I solved the task,you gave at the end of the video and I was excited, when it ran and everything was correct.

Ответить
Adebisi Adedoyin
Adebisi Adedoyin - 03.04.2023 14:18

result = 0
for sum in range(1,101):
sum = sum + result
result = result + 1
print(result,"+",end=' ')

Ответить
Hannah Gilbert
Hannah Gilbert - 31.03.2023 10:42

You’re brilliant - thank you :)

Ответить
Durga Mallesh Kopanathi.
Durga Mallesh Kopanathi. - 29.03.2023 16:14

love you bro nice class

Ответить
Girish GH
Girish GH - 28.03.2023 09:19

count=1
number=2
while count<=100 and number<=101:
ans=count+number
print(count,"+",number,"=",ans)
count=count+1
number=number+1

Ответить
G Theo.
G Theo. - 27.03.2023 12:44

Man you are born to teach.. even a 5 years old can understand you..

Ответить
Arun Kumar
Arun Kumar - 19.03.2023 22:35

Awesome Explanation Brother

Ответить
Данил Нигматулин
Данил Нигматулин - 15.03.2023 19:14

number = 100
product = 0

for sum in range(1, number + 1):
product = product + sum

print(product)

Ответить
MD Shahed
MD Shahed - 06.03.2023 10:52

# Initialize a variable to store the sum
total_sum = 0

# Loop through numbers from 1 to 100 and add them to the sum variable
for num in range(1, 101):
total_sum += num

# Print the total sum
print("The sum of numbers from 1 to 100 is:", total_sum)

Ответить
swagger
swagger - 19.02.2023 09:25

for i in range(1,101):
Sum+=i
print(Sum)

Ответить
Roger bain
Roger bain - 15.02.2023 19:42

can you put a lint to the repsitory ?

Ответить
zoey yuen
zoey yuen - 14.02.2023 08:18

For result in range(1,101):
Sum= i + result
Result += 1
Print(sum)

Ответить
Inspired X
Inspired X - 01.02.2023 09:39

programming Task solved:
this is Right?
x = 0
for count in range(0,100):
product = count + (x<= 100)
print(product)

Ответить
to pan
to pan - 25.01.2023 00:05

number = int(input("Enter an integer: "))

for count in range(1, 100):
product = number + count
print(number, "+", count, "=", product)

Provided: 1 / it should be this one code, if I am correct. If not - please correct me. Thanks!

Ответить
Osiris Estela
Osiris Estela - 29.12.2022 23:24

thanks!

Ответить
aidan adongo
aidan adongo - 22.12.2022 10:15

Please I don't get understand the trial Question🤷

Ответить
saurav singh
saurav singh - 20.12.2022 17:13

for i in range (1, 100):
print(i, "+", end=" ")
print(100, end=" ")
print("=", sum (range(1,101)))

Ответить
B.M. SAIFI RAHMAN LABIB
B.M. SAIFI RAHMAN LABIB - 11.12.2022 16:24

sum=0
print('sum of 1-100 is:')
for i in range(0,101):
sum=sum+i
if i==100:
print(sum)

Ответить
siddhant chauhan
siddhant chauhan - 05.12.2022 15:22

bro you are awesome by watching your videos i am feeling confident to give my practical

Ответить
banana_assasin
banana_assasin - 27.11.2022 19:30

this is the hardest thing ive learnt so far

Ответить
Arathi Sridarr
Arathi Sridarr - 14.11.2022 03:11

instead of count = count + 1 , you could type count +=1

Ответить
sm
sm - 12.11.2022 14:47

how can i find the solution of the task?

Ответить
Efe Ucar
Efe Ucar - 03.11.2022 22:39

this video was very helpful!

Ответить
sathvik reddy
sathvik reddy - 03.10.2022 17:27

number=int(input("enter an integer "))
for count in range(1,11):
product=number*count
print(number,"x",count,"=",product)

output: 9x10=90
i was not happy with this answer
at 7minutes:02 seconds
could you please help me with it.

Ответить
Chathuranga SL
Chathuranga SL - 28.09.2022 15:19

Thank you !

Ответить
brahima yoada
brahima yoada - 21.09.2022 11:06

This guy is the 🐐

Ответить
Brandon Littlejohn
Brandon Littlejohn - 07.09.2022 05:02

idk if you'll ever see this comment python sensei but i want you to know you deserve great things in life your videos have helped me so much in my learning journey

Ответить
Madhu Mahendran
Madhu Mahendran - 29.08.2022 10:40

Could anyone clarify me how the result of the sum of 1 to 100 is not executed in the rows but as sum of all? i believed the for loop will provide result in rows, like 1+1 =2
2+1=3 etc

Ответить
Newton Nandy
Newton Nandy - 15.08.2022 03:47

sum=0

for value in range(1,101):
sum= sum+value

print(sum)

Ответить
2k girl samayal👩‍🍳
2k girl samayal👩‍🍳 - 07.08.2022 19:58

Thank you sir 🙏 ☺

Ответить
Mekka kelvin
Mekka kelvin - 01.08.2022 15:51

Thanks for your clear enlightenment on python.
But mine did not work has yours did. It only took the last digit of the series of number who in my case was 20.
This is my code
Number = int(input("Enter an integer:"))
Product=number*count
Print(number, "X", count, "=", product)

Ответить
Alaska9ine9
Alaska9ine9 - 23.07.2022 22:14

i was looking for nested for loops

Ответить
Abhinav Jindal
Abhinav Jindal - 19.07.2022 17:58

Is there any way to do step or skip in python in for loop

Ответить
I'M I.A
I'M I.A - 07.07.2022 18:19

Can we print elements using "for" Loop side-by-side??
Can anyone get it??

Ответить
Ibekwe Victor
Ibekwe Victor - 03.07.2022 02:28

Thank you for this tutorial.

Ответить
Joyce Adhiambo
Joyce Adhiambo - 30.06.2022 02:38

my answer

number=int(input('Enter number:'))

for sequence in range(1,101):
sum=number+sequence
print(number,'+',sequence,'=',sum)

Ответить
ZombyWoof
ZombyWoof - 02.06.2022 00:52

You == awesome

Ответить
My Creative Corner
My Creative Corner - 26.05.2022 18:30

Great video👍, the way of your explanation is very good👌, all concepts are clear.

Ответить
Priyanshu kumar
Priyanshu kumar - 15.05.2022 09:11

Here it is...
Print("result")
For i in range(1,100):
Print(i,end="+")

Print(i+1)

Ответить