While Loop in Python (Perform a Task 1000000 times With Ease) #8

  Рет қаралды 216,710

Programiz

Programiz

Күн бұрын

A loop is a fundamental concept in all programming languages, not just Python. The while loop in Python is used to iterate over a block of code as long as the test expression (condition) is true.
🔥 Want to learn Python, the right way? Get my interactive Python course: bit.ly/right-python
In this video, we will learn about the while loop in Python. The while loop evaluates the test condition and runs the body of the loop as long as the test condition evaluates to true. At the end of the video, we will learn to write a program to print the multiplication table of a specified number.
~
Run Python Online: www.programiz.com/python-prog...
Programs in this video: github.com/programiz/python-c...
Python while loop (text-based tutorial): www.programiz.com/python-prog...
Python if...else statement: • Python if...else Condi...
Watch our videos and revise them with our Python App!
Download here for Android: bit.ly/learn-python-android
Download here for iOS: apple.co/3iPm6Sx
Timestamps:
0:00 Intro
0:33 Python while Loop
5:45 Multiplication Table using while
8:18 Programming Task
9:03 Recap
Find Programiz elsewhere:
Facebook: / programiz
Instagram: / _programiz
LinkedIn: / programiz
Website: www.programiz.com
-------------------------------------------------
While Loop in Python (Perform a Task 1000000 times With Ease) #8\
#python #learnprogramming #programiz #whileloop

Пікірлер: 205
@programizstudios
@programizstudios 2 жыл бұрын
🔥Finding it Damn Hard to Understand Python? Learn to code-the right way-with interactive lessons, quizzes & challenges. Build a strong programming base; it's IMPORTANT! Try Programiz PRO for Free: bit.ly/interactive-py
@keghushahembagabriel4764
@keghushahembagabriel4764 3 жыл бұрын
I'm new to programming and I actually find your tutoring awesome. Thank you.
@smdsongs2625
@smdsongs2625 3 жыл бұрын
Best KZbin teacher . Thank you for the wonderful video with Tasks.... your way of speaking is awesome.
@hyper-thegamechanger3667
@hyper-thegamechanger3667 2 жыл бұрын
yes sir i have got it without looking in git hub I just start coding yesterday, this video is very helpful. Code number = int(input('Enter a number:')) count = 10 while count >= 1: product = number * count print (number, 'x', count, '=', product) count = count - 1
@Alche__
@Alche__ 2 жыл бұрын
Honestly sir! Your lessons are so clear and well laid out, thank you so much!!
@dangerdemander6476
@dangerdemander6476 2 жыл бұрын
for the programing task you can also do ; number = int(input("enter the number: ")) count = 10 while count =1 : product = number * count print(number,"*",count,"=",product) count -= 1 hope it works for you all too
@fookivansh4667
@fookivansh4667 2 жыл бұрын
thanks it helped me i was doing while count = 1
@dangerdemander6476
@dangerdemander6476 2 жыл бұрын
@@fookivansh4667 yeah sure buddy 🙏
@Naveenbabuborugadda
@Naveenbabuborugadda Жыл бұрын
I haven't used "and" but made the answer changing 1 to 10 and 10 to 1. Also less that or equal to to greater than or equal to.
@harsharaj6477
@harsharaj6477 2 жыл бұрын
Programiz always is helpful for a beginner to learn and understand coding concepts! Looking forward to learning some more advanced concepts with better clarity and approach as always by tutor(Punit).
@samsquirkshop7388
@samsquirkshop7388 2 жыл бұрын
These vids are some of the best learning material I've ever seen!
@hellaevie
@hellaevie 2 жыл бұрын
Thank you! clean explanation so that I can complete a hw assignment! before I watch the next vid on "for loops" good rec on the app! love the option being able to continue learning :)
@niran_playzofficial5334
@niran_playzofficial5334 2 жыл бұрын
8:18 I have completed the programing task myself thank you for your explanation and ur support
@rosaf4661
@rosaf4661 2 жыл бұрын
thank you so much! i really needed some guidance for my class.
@mohammadadibaslam1856
@mohammadadibaslam1856 3 жыл бұрын
Great Explanation Bro!! pehli baar while function samajh main aaya...great job..
@sureshvarthya2250
@sureshvarthya2250 2 жыл бұрын
num=int(input("enter the number:")) i=1 while i #while loop executes n no of steps in more than one line #print("Thank you sir, for your brilliant teaching")
@meray2magdy975
@meray2magdy975 3 жыл бұрын
actually you are awesome. probably the best youtube programmer
@avantika6077
@avantika6077 6 ай бұрын
Something I thought I understood months ago, after watching this, I made conclusions that I haven't understood it better, until now.
@adabujiki
@adabujiki Жыл бұрын
Veryy, Verryyy good explaination of the details of while-loops, he explains every line, and its effect. THANK YOU!!
@banana_assasin3907
@banana_assasin3907 Жыл бұрын
this was very helpful and i also found it better to predict what youre going to do before you do it to see if I've learned
@jonfortier3664
@jonfortier3664 3 жыл бұрын
Absolutely Beautiful Lectures ..
@poojashedge266
@poojashedge266 Жыл бұрын
Sir please continue this series .And please make advance topic aswell.Big thank you for the content.
@SamuelSantos-bx2rh
@SamuelSantos-bx2rh 2 жыл бұрын
this is a very clear lecture, thanks!
@BabyMeraLearn
@BabyMeraLearn 3 ай бұрын
Very nice video,easy to understand. Keep up the good work. God Bless You!
@adegbamiyestephen2521
@adegbamiyestephen2521 3 жыл бұрын
Very Good Video I've been looking for a specific solution to this type of problem but your video has really help me thanks one more time
@henryohia8818
@henryohia8818 2 жыл бұрын
Very understandable better then the other ones i have watched
@CallmeMrRoyal
@CallmeMrRoyal Жыл бұрын
Thank you for the videos, your explanation is so much clear and simple, it makes me to understand logical behind
@hunterr1330
@hunterr1330 3 жыл бұрын
I am a beginner in python!(aslo i have a doubt!) How to add loop when an operation is executed,i mean if i executed a sum on calculator (made by me through python) then i made a statement which says that if the calculation is over then type "y" and if not (if they want to continue solving sums) then type "n" then,how can i loop that python code for calculator by to loop / for loop??? Please help me out!
@sohamsrkr
@sohamsrkr 2 жыл бұрын
thank you so much i really found this useful in my recent project
@BrokeCanadian
@BrokeCanadian 3 жыл бұрын
This guy is the best teacher ever!
@TherealTNCjah
@TherealTNCjah 2 жыл бұрын
Yeah like how is he so good God dam
@majidalich2947
@majidalich2947 2 жыл бұрын
number = int(input('Enter the number : ')) count = 10 while (count 0): product = number * count print(number, 'x', count, '= ', product) count -= 1
@zeroday9551
@zeroday9551 Жыл бұрын
Thanks mate! I couldn't understand the idea of i+=1. Now I know the way you explained is we can write either count +=1 or count = count+1. Thank you.
@chinfra
@chinfra 2 жыл бұрын
brazil must be closer to india. we have very much to learn with you, brother. your polite, cool and very simply way to talk. that made us very comfortable to learn. thanx a lot buy sharing knowlodge. i wish to you and your people much luck and much health. fraternal hugs from a brazilian brother
@thelegendarysummersky3189
@thelegendarysummersky3189 6 ай бұрын
number = int(input("Enter a number: ")) count = 10 while count >= 1: product = number * count print(number, "x", count, "=", product) count = count - 1
@memineand
@memineand 3 жыл бұрын
Thank you so much It helped me to solve me my queries 😌
@kartikudainiya2328
@kartikudainiya2328 3 жыл бұрын
a=int(input("enter a number:")) count=10 while count >= 1: pro=count*a print(a, "X", count, "=", pro) count=count-1 one time correct
@Yogansh67
@Yogansh67 2 жыл бұрын
Thank you sir for amazing teaching... Answer of the question no= int(input("enter ur no.")) now=10 while now >= 1: pro= no * now print(no , "x" , now , "=" , pro) now = now-1
@kushpatelstudent6862
@kushpatelstudent6862 2 жыл бұрын
these videos are very helpful, you got my sub
@sanskarkumar464
@sanskarkumar464 3 жыл бұрын
Yes, I do know most of you know the answer to make a reversed table of a number table = int(input('Enter a number for multiplication')) count = 10 while count >= 1: answer = table*count print(table, "*", count, "=" ,answer) count -= 1
@cristianacrestani5941
@cristianacrestani5941 2 жыл бұрын
table = int(input('Enter a number for multiplication')) count = 10 while count >= 1: answer = table*count print(table, "*", count, "=" ,answer) count= count-1 GREAT TUTORIAL: you guys rock!!!
@macarioinmenzo3365
@macarioinmenzo3365 2 жыл бұрын
count = 1 number = int(input("Enter a number: ")) while count
@kimbo5175
@kimbo5175 2 жыл бұрын
I can only ecoh what others have said already, thank you!
@hangon552
@hangon552 2 жыл бұрын
a = int(input("Enter your number > ")) b = 11 while b>=2: b = b-1 c = a * b print(a,"X",b,"=",c)
@mrziyaad01
@mrziyaad01 2 жыл бұрын
If you have written loads of lines of code already, how would you get that code into a while loop so the program can repeat itself?
@mahima979
@mahima979 2 жыл бұрын
Thank you! V. helpful!!
@vedanshchn
@vedanshchn 2 жыл бұрын
8:30 Solution: # Multiplication table reverse order num = int(input("Enter a number: ")) count = 10 while (count >= 1): print(num, "*", count, "=", (num * count)) count -= 1
@joyceadhiambo9977
@joyceadhiambo9977 2 жыл бұрын
HEY ved it works ...i have seen what i was missing. but remove the -= to - number = int(input('Enter number:')) count = 10 while count >= 1: product= number* count print(number,'x',count,'=',product) count= count-1 .Happy coding!!!!
@Gayathrimitra
@Gayathrimitra Жыл бұрын
really I loved this channel
@hasnainabbas8757
@hasnainabbas8757 2 жыл бұрын
Concepts are awesome ✨
@faisalkhattak8608
@faisalkhattak8608 2 жыл бұрын
8:36 number = int(input("enter number: ")) count = 10 while count >= 1: product = number * count print(number, "X", count, "=", product) count = count - 1
@tarabelbase8120
@tarabelbase8120 3 жыл бұрын
**pythan program** While(You make video) { print("You channel grow very soon") } if(You stop Teaching) { print("Please continue Teaching") } **C program** #include int main() { int choose; do{ while(You teaching) { printf("You channel grow very fast"); if(You stop teaching) { printf("presh 1 for continue Teaching"); scanf("%d",&choose); } while(choose); return 0; }
@lastonline2614
@lastonline2614 3 жыл бұрын
great..
@vaishnavi7203
@vaishnavi7203 3 жыл бұрын
Very nice tutorial 👍
@r.itesh09
@r.itesh09 3 жыл бұрын
Best explanation Thanks sir.....
@life-yq7zp
@life-yq7zp 2 жыл бұрын
Thank u soo much SIR ,totally helpful
@ponenik1691
@ponenik1691 3 жыл бұрын
good content! :)
@dolfinho87
@dolfinho87 2 жыл бұрын
Excelente! Thanks!
@sayandutta3205
@sayandutta3205 3 жыл бұрын
#TASK number = int(input("enter a number: ")) count = 10 while count >= 1: product = (number * count) print(number, "x" ,count, "=", product) count = count - 1
@x704bhargav2
@x704bhargav2 3 жыл бұрын
Correct
@choureabhishek7512
@choureabhishek7512 3 жыл бұрын
Thanks For Code 😊🙏🏻
@sayandutta3205
@sayandutta3205 3 жыл бұрын
@@choureabhishek7512 You're welcome
@vedanshchn
@vedanshchn 2 жыл бұрын
I managed to write this! # Mutiplication table num = int(input("Enter a number: ")) count = 1 while (count
@aryadubbewar7446
@aryadubbewar7446 2 жыл бұрын
You are the best teacher 🙂.
@astroloxi8133
@astroloxi8133 3 жыл бұрын
is endif and endwhile used in python or is that in pseudocode?
@shakingitoff
@shakingitoff 2 жыл бұрын
fun little random additions: main_loop = True import time while main_loop: number = input('Number: ') try: # executes test block below to check for errors int(number) loop_condition = True main_loop = False time.sleep(0.5) # delays program for dramatic effect print('Calculating...') time.sleep(1.2) except ValueError: print('Please enter integer value only') loop_condition = False loop_count = 0 count = 10 while loop_condition and loop_count < 10: multiple = int(number) * count print(str(number), '*', str(count), '=', multiple) count -= 1 loop_count += 1
@saramahmoud8034
@saramahmoud8034 3 жыл бұрын
amazing. thanks a lot
@samp2286
@samp2286 2 жыл бұрын
hi guys def top_x(x): for i in range(x): new_str = str(i + 1) + ". " + response_dict["data"][i]["symbol"] return new_str when I call the function it returns once (the first value of i), how does iteration work in this code?
@harsha123kumar8
@harsha123kumar8 2 жыл бұрын
Hi sir can we use reverse function in line product= reverse.(number,x,count, = product).
@Funnyvideos____2
@Funnyvideos____2 Жыл бұрын
This video is very helpful ❤
@revenge9431
@revenge9431 3 жыл бұрын
Hello, If i have a list of 100 and I want to only Loop through the 100 by increments of 5 while not repeating the previous increments already in the loop. how do I do that? For example: Loop through the first 5 then start 6-10 then 11-15 and so on please help thanks
@rosaf4661
@rosaf4661 2 жыл бұрын
Im trying to sort out the same thing. I hope you figured it out
@evilnikhil6021
@evilnikhil6021 3 жыл бұрын
👍👍👍 I need this content
@vrushalibhise7375
@vrushalibhise7375 3 жыл бұрын
##for that reverse table of 6 : num=int(input("Enter your number:")) count= 10 while count >= 0 : product = number * count print(num, "x" , count, "=" , product) count = count - 1 I wrote this code and it worked! Thanks for the video!!!!!!!!!!!!! ^_^
@rocketstar7791
@rocketstar7791 2 жыл бұрын
damn thanks, in line - while count >= 0 , i just put count = 0 and it doesn't work :)
@abhaymehta3770
@abhaymehta3770 2 жыл бұрын
sir, can you help me to find maximum and minimum number from the numbers that are entered by user using while loop ?
@praveenasurya3211
@praveenasurya3211 2 жыл бұрын
Hi sir,Can you please provide more examples on while and for loop?
@osirisestela3414
@osirisestela3414 Жыл бұрын
thanks man!
@AbdulRahman-qv1kj
@AbdulRahman-qv1kj 2 жыл бұрын
print("-----------------multiplication table-----------------") number=int(input("which table do you want?")) count = 10 while count >= 1: product = number * count print(number, "x", count, "=", product) count = count - 1
@meghanajana621
@meghanajana621 5 ай бұрын
n = int(input("Enter a number : ")) c = 10 while c >= 1: p = n*c print(n,"x",c,"=",p) c = c - 1
@cubez7
@cubez7 4 ай бұрын
It is very helpful
@yogeshabd5235
@yogeshabd5235 2 жыл бұрын
bro, u are u doing great work.
@shadymohamed7017
@shadymohamed7017 Жыл бұрын
u r amazing. thanks
@kartikudainiya2328
@kartikudainiya2328 3 жыл бұрын
pls keep it free always because i will unable to pay and you explanation is best top superb ultimate awesome
@hanshrajkumar7884
@hanshrajkumar7884 2 жыл бұрын
Thank you so much sir❤️
@adityapatel520
@adityapatel520 2 жыл бұрын
reverse table def adi (): num= int(input("enter a number : ")) print ("multiplication table of " , num , "is :-" ) n = 10 while n >= 0: pro= num * n print(num , "x", n, "=", pro) n-=1 >>> adi() enter a number : 9 multiplication table of 9 is :- 9 x 10 = 90 9 x 9 = 81 9 x 8 = 72 9 x 7 = 63 9 x 6 = 54 9 x 5 = 45 9 x 4 = 36 9 x 3 = 27 9 x 2 = 18 9 x 1 = 9 9 x 0 = 0
@joyceadhiambo9977
@joyceadhiambo9977 2 жыл бұрын
hey i got my answer but it wont stop looping. What am i missing number = int(input('Enter number:')) count = 10 while count
@sandipansarkar9211
@sandipansarkar9211 3 жыл бұрын
great explanation
@crafty329
@crafty329 3 жыл бұрын
Omg thank you so much
@wildmerbotplaysdbd
@wildmerbotplaysdbd 2 жыл бұрын
Thank you
@DigitalAcademyOnline
@DigitalAcademyOnline 3 жыл бұрын
Learning Python is something you would like to get in your skills, but you do not know where to start? This NEW channel will help you out leaning Python Programming from scratch - for complete Beginners, Intermediate and Advanced Levels
@Jaco.productions147
@Jaco.productions147 2 жыл бұрын
answer number = int(input("enter number: ")) count = 10 while count >= 1: product = number * count print (number, "x", count, "=", product) count = count - 1
@SahilShaikh-7
@SahilShaikh-7 Жыл бұрын
number = int(input('Enter the number: ')) count = 10 while count >= 1: product = number * count print(number,'X',count,'=',product) count -= 1
@pkanyaa4988
@pkanyaa4988 2 жыл бұрын
answer for the practice question : number = int(input("enter the number: ")) count = 10 while count>0: product = number*count print(number, "*", count, "=", product) count = count - 1
@user-vm5xk6sw7d
@user-vm5xk6sw7d 7 ай бұрын
value = int(input("enter any number to multipy: ")) i = 10 while i >= 1: print("{} * {} = {}".format(value, i, value * i)) i-=1
@mrt8bit692
@mrt8bit692 2 жыл бұрын
I GOT THE CODE THAT WORKS! number = int(input("Enter a Number 1 Through 12: ")) count = 12 while count >= 1: product = number * count print(number, "x", count, "=", product) count = count - 1
@priyanpriyankan7014
@priyanpriyankan7014 Жыл бұрын
answer to the 8.13 number = int(input("enter a number: ")) count= 10 while count >0: product = count * number print(number, '*', count, "=" , product) count = count -1
@NoorUllah-rm6un
@NoorUllah-rm6un 11 ай бұрын
thank you
@mdiftekhar6876
@mdiftekhar6876 2 жыл бұрын
number=int(raw_input("enter the table:")) count=10 while count=1: product=number*count print(number, "x",count,"=", product) count = count - 1
@benjaminxiong553
@benjaminxiong553 3 жыл бұрын
Im taking AP CSP and this video omfg clarified a while loop so much ty
@nomansiddique
@nomansiddique 3 жыл бұрын
num = int(input("Enter the number :")) count = 10 while count = 1 : product = num * count print(num, "x",count,"=",product) count = count - 1
@programizstudios
@programizstudios 3 жыл бұрын
Nice work. There is a suggestion however. We do not need to check "count = 1".
@choureabhishek7512
@choureabhishek7512 3 жыл бұрын
Thanks For Code 🙏🏻😊
@Project.i
@Project.i 4 ай бұрын
#reverse multipication table using while loop number= int(input("Enter a number: ")) count= 10 while count>=1: equals= number * count print(number, "*", count,"=", equals) count = count - 1
@kurakulakalyan987
@kurakulakalyan987 3 жыл бұрын
a=int(input('enter the number:')) count=10 while count0: product=a*count print(a,'*',count,'=',product) count=count-1
@abhiramanne9649
@abhiramanne9649 3 жыл бұрын
you ppl are working hard! thankyou SOO much!
@kushanchaudhary5930
@kushanchaudhary5930 3 жыл бұрын
how to repeat full program using an element input as an indicator by the user ? I am actually building a calculator which can output a remainder or quotient of two numbers, i want to kmow how to repeat the full program so that the user might not need to run it again and he can rerun just by inputing an element.
@dagdbot83
@dagdbot83 3 жыл бұрын
Send the code
@swagger1982
@swagger1982 Жыл бұрын
num = int(input ( "enter a number:")) count=10 while count >=1: product =number*count print(num ,"×",count,"=",product ) count-=1
@sohammaitixaroll1376
@sohammaitixaroll1376 Ай бұрын
num = 10 count = int(input("put the number =")) while num >=0 : mul = count * num print(count,"*",num,"=",mul) num -= 1
@omarm3649
@omarm3649 2 жыл бұрын
Good video
@vigneshreddychejarla6072
@vigneshreddychejarla6072 2 жыл бұрын
number=int(input("enter a number:")) count=10 while (count0): product=number*count print(number,'x',count,"=",product) count=count-1
@bharadwajs3475
@bharadwajs3475 3 жыл бұрын
Ooh sir thanks ❤ so much. I was searching for while loop in KZbin but every KZbinr is not explaining well and not giving work to learn. A Big thanks to programiz and you 🙂🙂😇☺😊😍
@sukakomen4835
@sukakomen4835 2 жыл бұрын
number=int(input("Enter a number:")) count=10 while count>0: product=number*count print('{} * {} = {}'.format(number,count,product)) count-=1
@vamshid-gp8pw
@vamshid-gp8pw 2 ай бұрын
number = int(input("Enter a number:")) count = 10 while count>=1: product = number*count print(number, "x", count, "=", product) count = count - 1 test done sir
@zainulabdeen7074
@zainulabdeen7074 2 жыл бұрын
number = int(input("enter anumber ")) count = 10 while count0: product=number * count print(number, "x", count, "=", product) count = count - 1
"break" & "continue" Statements in Python #10
8:01
Programiz
Рет қаралды 99 М.
Python Functions (The Only Guide You'll Need) #12
17:20
Programiz
Рет қаралды 567 М.
Useful gadget for styling hair 🤩💖 #gadgets #hairstyle
00:20
FLIP FLOP Hacks
Рет қаралды 10 МЛН
Stay on your way 🛤️✨
00:34
A4
Рет қаралды 26 МЛН
Best KFC Homemade For My Son #cooking #shorts
00:58
BANKII
Рет қаралды 72 МЛН
5 Useful F-String Tricks In Python
10:02
Indently
Рет қаралды 288 М.
#12: while Loop in C Programming |  C Programming for Beginners
12:45
For Loop in Python (So Easy to Understand) #9
9:03
Programiz
Рет қаралды 161 М.
While loops in Python are easy ♾️
6:58
Bro Code
Рет қаралды 334 М.
Learn Python Functions - Quick Python Project For Beginners
10:04
Python Simplified
Рет қаралды 91 М.
How I would learn to code (If I could start over)
9:16
Jason Goodison
Рет қаралды 4,7 МЛН