Writing a code program in Python using While loop and if statement | Python for beginners in Hindi

Published: 30 December 2020
on channel: ifactner
245
7

We write a code guessing program in Python using the while loop and if statement in lesson 16 of Python for beginners in Hindi Urdu course.
We discuss how to to use the while loops and if statements to write a simple code guessing program as follows:
While loop and if statement - Enter code
correct_code = 1234
check_limit = 0

while check_limit (less than sign) 3:
user_code = int(input('Enter code: '))
check_limit = check_limit + 1
if user_code == correct_code:
print('Correct code')
break
else:
print('Wrong code')

Watch also:
1. Python basics programming tutorial for beginners | Python print hello world code in Hindi Urdu - part 1 at    • Python basics programming tutorial for beg...  .

2. Print function in Python to display multiple lines | Python programming tutorial in Hindi Urdu at    • Print function in Python to display multip...  

3. Introduction to Variables in Python | Python programming tutorial in Hindi Urdu at    • Introduction to Variables in Python | Pyth...  

4. Concatenation of strings and variables in PYTHON | Concatenating and type function in Python at    • Concatenation of strings and variables in ...  

5. Input function in Python with string function and concatenation | Python for beginners in Hindi Urdu at    • Input function in Python with string funct...  

6. Input function in Python with str and int functions for calculations | Python in Hindi Urdu at    • Input function in Python with str and int ...  

7. Python tutorial in Hindi Urdu | Convert cm to inches & Kgs to pounds in Python programming lesson 7 at    • Python tutorial in Hindi Urdu | Convert cm...  

8. Python string slicing and string indexes | Python tutorial for beginners in Hindi Urdu lesson 8 at    • Python string slicing and string indexes |...  

9. Formatted string in Python F-Strings in Python for string formatting for beginners in Hindi Urdu at    • Formatted string in Python F-Strings in Py...  

12. Arithmetic operators precedence and BEDMAS rule in Python | Python for beginners in Hindi Urdu 12 at    • Arithmetic operators precedence and BEDMAS...  

13. Implicit and explicit conversion concepts in Python | Python for beginners in Hindi Urdu lesson 13 at    • Implicit and explicit conversion concepts ...  

15. While loop in Python pattern printing | Python tutorial for beginners in Hindi Urdu lesson 15 at    • While loop in Python pattern printing | Py...  

Full Python course in Hindi Urdu playlist at    • Python programming course in Hindi Urdu  .


On this page of the site you can watch the video online Writing a code program in Python using While loop and if statement | Python for beginners in Hindi with a duration of hours minute second in good quality, which was uploaded by the user ifactner 30 December 2020, share the link with friends and acquaintances, this video has already been watched 245 times on youtube and it was liked by 7 viewers. Enjoy your viewing!