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

  Рет қаралды 214,536

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

Пікірлер: 204
@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
@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
@keghushahembagabriel4764
@keghushahembagabriel4764 3 жыл бұрын
I'm new to programming and I actually find your tutoring awesome. Thank you.
@smdsongs2625
@smdsongs2625 3 жыл бұрын
Best KZfaq teacher . Thank you for the wonderful video with Tasks.... your way of speaking is awesome.
@vivkkush
@vivkkush 3 жыл бұрын
8:24 n = int(input("write down the number : ")) count = 10 while count > 0: product = n * count print(n, "x", count, "=", product) count = count - 1
@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
@avantika6077
@avantika6077 3 ай бұрын
Something I thought I understood months ago, after watching this, I made conclusions that I haven't understood it better, until now.
@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).
@niran_playzofficial5334
@niran_playzofficial5334 2 жыл бұрын
8:18 I have completed the programing task myself thank you for your explanation and ur support
@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")
@samsquirkshop7388
@samsquirkshop7388 2 жыл бұрын
These vids are some of the best learning material I've ever seen!
@BrokeCanadian
@BrokeCanadian 3 жыл бұрын
This guy is the best teacher ever!
@TherealTNCjah
@TherealTNCjah 2 жыл бұрын
Yeah like how is he so good God dam
@meray2magdy975
@meray2magdy975 3 жыл бұрын
actually you are awesome. probably the best youtube programmer
@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 :)
@jonfortier3664
@jonfortier3664 3 жыл бұрын
Absolutely Beautiful Lectures ..
@rosaf4661
@rosaf4661 2 жыл бұрын
thank you so much! i really needed some guidance for my class.
@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
@adabujiki
@adabujiki Жыл бұрын
Veryy, Verryyy good explaination of the details of while-loops, he explains every line, and its effect. THANK YOU!!
@mohammadadibaslam1856
@mohammadadibaslam1856 3 жыл бұрын
Great Explanation Bro!! pehli baar while function samajh main aaya...great job..
@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.
@SamuelSantos-bx2rh
@SamuelSantos-bx2rh 2 жыл бұрын
this is a very clear lecture, thanks!
@BabyMeraLearn
@BabyMeraLearn Ай бұрын
Very nice video,easy to understand. Keep up the good work. God Bless You!
@majidalich2947
@majidalich2947 2 жыл бұрын
number = int(input('Enter the number : ')) count = 10 while (count 0): product = number * count print(number, 'x', count, '= ', product) count -= 1
@henryohia8818
@henryohia8818 2 жыл бұрын
Very understandable better then the other ones i have watched
@thelegendarysummersky3189
@thelegendarysummersky3189 4 ай бұрын
number = int(input("Enter a number: ")) count = 10 while count >= 1: product = number * count print(number, "x", count, "=", product) count = count - 1
@poojashedge266
@poojashedge266 Жыл бұрын
Sir please continue this series .And please make advance topic aswell.Big thank you for the content.
@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
@CallmeMrRoyal
@CallmeMrRoyal Жыл бұрын
Thank you for the videos, your explanation is so much clear and simple, it makes me to understand logical behind
@sohamsrkr
@sohamsrkr 2 жыл бұрын
thank you so much i really found this useful in my recent project
@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
@danilopiona
@danilopiona 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
@hasnainabbas8757
@hasnainabbas8757 2 жыл бұрын
Concepts are awesome ✨
@adegbamiyestephen2521
@adegbamiyestephen2521 2 жыл бұрын
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
@kushpatelstudent6862
@kushpatelstudent6862 2 жыл бұрын
these videos are very helpful, you got my sub
@Gayathrimitra
@Gayathrimitra Жыл бұрын
really I loved this channel
@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
@r.itesh09
@r.itesh09 3 жыл бұрын
Best explanation Thanks sir.....
@vedanshchn
@vedanshchn 2 жыл бұрын
I managed to write this! # Mutiplication table num = int(input("Enter a number: ")) count = 1 while (count
@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)
@memineand
@memineand 3 жыл бұрын
Thank you so much It helped me to solve me my queries 😌
@kimbo5175
@kimbo5175 2 жыл бұрын
I can only ecoh what others have said already, thank you!
@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..
@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
@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
@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 Жыл бұрын
damn thanks, in line - while count >= 0 , i just put count = 0 and it doesn't work :)
@mahima979
@mahima979 2 жыл бұрын
Thank you! V. helpful!!
@vaishnavi7203
@vaishnavi7203 3 жыл бұрын
Very nice tutorial 👍
@life-yq7zp
@life-yq7zp 2 жыл бұрын
Thank u soo much SIR ,totally helpful
@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 🙏🏻😊
@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
@aryadubbewar7446
@aryadubbewar7446 2 жыл бұрын
You are the best teacher 🙂.
@dolfinho87
@dolfinho87 2 жыл бұрын
Excelente! Thanks!
@Funnyvideos____2
@Funnyvideos____2 Жыл бұрын
This video is very helpful ❤
@hunterr1330
@hunterr1330 2 жыл бұрын
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!
@meghanajana621
@meghanajana621 3 ай бұрын
n = int(input("Enter a number : ")) c = 10 while c >= 1: p = n*c print(n,"x",c,"=",p) c = c - 1
@saramahmoud8034
@saramahmoud8034 3 жыл бұрын
amazing. thanks a lot
@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 Жыл бұрын
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!!!!
@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?
@hanshrajkumar7884
@hanshrajkumar7884 2 жыл бұрын
Thank you so much sir❤️
@kurakulakalyan987
@kurakulakalyan987 3 жыл бұрын
a=int(input('enter the number:')) count=10 while count0: product=a*count print(a,'*',count,'=',product) count=count-1
@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 9 ай бұрын
number = int(input('Enter the number: ')) count = 10 while count >= 1: product = number * count print(number,'X',count,'=',product) count -= 1
@yogeshabd5235
@yogeshabd5235 2 жыл бұрын
bro, u are u doing great work.
@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
@shadymohamed7017
@shadymohamed7017 Жыл бұрын
u r amazing. thanks
@evilnikhil6021
@evilnikhil6021 3 жыл бұрын
👍👍👍 I need this content
@cubez7
@cubez7 2 ай бұрын
It is very helpful
@Project.i
@Project.i Ай бұрын
#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
@ponenik1691
@ponenik1691 3 жыл бұрын
good content! :)
@sandipansarkar9211
@sandipansarkar9211 3 жыл бұрын
great explanation
@nandhagopal2002
@nandhagopal2002 Жыл бұрын
Programming Task num=int(input("enter a number:")) count =10 while(count>0): product=count*num print(num,"x",count,"=", product) count=count-1 OUTPUT enter a number:6 6 x 10 = 60 6 x 9 = 54 6 x 8 = 48 6 x 7 = 42 6 x 6 = 36 6 x 5 = 30 6 x 4 = 24 6 x 3 = 18 6 x 2 = 12 6 x 1 = 6
@aritradey7189
@aritradey7189 Жыл бұрын
# Reverse multiplication table: number=int(input("Enter a number: ")) count = 10 while count >= 1: product=number * count print(number , "*" , count , "=" ,product) count=count-1
@benjaminxiong553
@benjaminxiong553 3 жыл бұрын
Im taking AP CSP and this video omfg clarified a while loop so much ty
@osirisestela3414
@osirisestela3414 Жыл бұрын
thanks man!
@user-vm5xk6sw7d
@user-vm5xk6sw7d 4 ай бұрын
value = int(input("enter any number to multipy: ")) i = 10 while i >= 1: print("{} * {} = {}".format(value, i, value * i)) i-=1
@zainulabdeen7074
@zainulabdeen7074 2 жыл бұрын
number = int(input("enter anumber ")) count = 10 while count0: product=number * count print(number, "x", count, "=", product) count = count - 1
@astroloxi8133
@astroloxi8133 3 жыл бұрын
is endif and endwhile used in python or is that in pseudocode?
@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?
@vigneshreddychejarla6072
@vigneshreddychejarla6072 Жыл бұрын
number=int(input("enter a number:")) count=10 while (count0): product=number*count print(number,'x',count,"=",product) count=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
@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
@abhiramanne9649
@abhiramanne9649 3 жыл бұрын
you ppl are working hard! thankyou SOO much!
@sukakomen4835
@sukakomen4835 2 жыл бұрын
number=int(input("Enter a number:")) count=10 while count>0: product=number*count print('{} * {} = {}'.format(number,count,product)) count-=1
@crafty329
@crafty329 2 жыл бұрын
Omg thank you so much
@swagger1982
@swagger1982 Жыл бұрын
num = int(input ( "enter a number:")) count=10 while count >=1: product =number*count print(num ,"×",count,"=",product ) count-=1
@kartikudainiya2328
@kartikudainiya2328 3 жыл бұрын
pls keep it free always because i will unable to pay and you explanation is best top superb ultimate awesome
@wildmerbotplaysdbd
@wildmerbotplaysdbd 2 жыл бұрын
Thank you
@ASITGOYAL_COMMONMAN
@ASITGOYAL_COMMONMAN 2 жыл бұрын
# program to tell table upto ten count = int(input('which table do i tell you? ')) multiple = 1 while multiple
@darknightpassionable
@darknightpassionable 2 жыл бұрын
#home task..... multiplication table(descending order) number = int(input("enter a number : ")) count = 10 while 0
@vamshid-gp8pw
@vamshid-gp8pw 9 күн бұрын
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
@mdaadil1048
@mdaadil1048 3 жыл бұрын
count = 5 while count
@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
@joyceadhiambo9977
@joyceadhiambo9977 Жыл бұрын
hey i got my answer but it wont stop looping. What am i missing number = int(input('Enter number:')) count = 10 while count
@praveenasurya3211
@praveenasurya3211 2 жыл бұрын
Hi sir,Can you please provide more examples on while and for loop?
@harsha123kumar8
@harsha123kumar8 2 жыл бұрын
Hi sir can we use reverse function in line product= reverse.(number,x,count, = product).
@bharadwajs3475
@bharadwajs3475 3 жыл бұрын
Ooh sir thanks ❤ so much. I was searching for while loop in KZfaq but every KZfaqr is not explaining well and not giving work to learn. A Big thanks to programiz and you 🙂🙂😇☺😊😍
@shubhampandey6706
@shubhampandey6706 Жыл бұрын
#printing table in reverse order num=int(input("Enter a number")) count=10 while count>=1: product=count*num print(num,'x',count,'=',product) count=count-1
"break" & "continue" Statements in Python #10
8:01
Programiz
Рет қаралды 97 М.
Python Functions (The Only Guide You'll Need) #12
17:20
Programiz
Рет қаралды 543 М.
BRUSH ONE’S TEETH WITH A CARDBOARD TOOTHBRUSH!#asmr
00:35
HAYATAKU はやたく
Рет қаралды 34 МЛН
Giving 1000 Phones Away
00:18
MrBeast
Рет қаралды 27 МЛН
ДЕНЬ РОЖДЕНИЯ БАБУШКИ #shorts
00:19
Паша Осадчий
Рет қаралды 3,7 МЛН
For Loop in Python (So Easy to Understand) #9
9:03
Programiz
Рет қаралды 159 М.
5 Useful F-String Tricks In Python
10:02
Indently
Рет қаралды 245 М.
Learn JavaScript WHILE LOOPS in 8 minutes! 🔁
8:12
Bro Code
Рет қаралды 17 М.
Solve any Star Pattern program in Python
18:44
Simply Coding
Рет қаралды 836 М.
While loops in Python are easy ♾️
6:58
Bro Code
Рет қаралды 302 М.
I visited the world's hardest math class
12:50
Gohar Khan
Рет қаралды 119 М.
Python if...else Conditionals (for Decision Making) # 7
11:28
Programiz
Рет қаралды 129 М.
#20 Python Tutorial for Beginners | While Loop in Python
12:43
Telusko
Рет қаралды 1,5 МЛН
BRUSH ONE’S TEETH WITH A CARDBOARD TOOTHBRUSH!#asmr
00:35
HAYATAKU はやたく
Рет қаралды 34 МЛН