Войти
  • 1797389Просмотров
  • 7 лет назадОпубликованоTelusko

#20 Python Tutorial for Beginners | While Loop in Python

Check out our courses: AI Powered DevOps with AWS - Live Course :- Coupon: TELUSKO10 (10% Discount) Complete Java Developer Course Batch-4: Coupon: TELUSKO10 (10% Discount) Master Java Spring Development : Coupon: TELUSKO20 (20% Discount) Udemy Courses: Spring: Java:- Java Spring:- Java For Programmers:- Python : Git : Docker : For More Queries WhatsApp or Call on : +919008963671 website : Instagram : Linkedin : TELUSKO Android App : In this lecture, we will learn: - Loops in Python language - What is the use of loops? - While loop and its implementation - Syntax of the while loop - Nested while loops in python - What is the 'end' parameter in python? #1 - We can execute a statement multiple times, by using the loops. - There are two types of a loop: 1. For loop 2. While loop - In the while loop, we need a counter to count the number of times, a statement can be executed. - We also have to put a condition in a while loop to repeat a statement until the given condition is satisfied. - The while Loop. With the while loop, we can execute a set of statements as long as a condition is true. - When the condition becomes false, the line immediately after the loop in the program is executed. - The value of the counter will increase or decrease until the condition gets false. #2 - Syntax of the while loop:- counter variable while (condition): statements; incrementation/ decrementation - So, there must be three things in a while loop:- 1. Initialization 2. Condition 3. Increment / Decrement - Nested while loops can also be used in Python. - Nested while loop simply means that a loop inside another loop. #3 - To print the values in the same, we use (end=" "). The value will not come in the new line after using it. - Passing the whitespace to the end parameter (end=' ') indicates that the end character has to be identified by whitespace and not a new line. Github :- Python for Beginners :- Editing Monitors : Java:- Spring:- More Learning : Java :- Python :- Django :- JavaScript :- Node JS :- Rest Api :- Servlet :- Spring Framework :- Design Patterns in Java :- Docker :- Blockchain Tutorial :- Corda Tutorial:- Hyperledger Fabric :- NoSQL Tutorial :- Mysql Tutorial :- Data Structures using Java :- Git Tutorial :- Donation: PayPal Id : navinreddy20