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

Опубликовано: 30 Декабрь 2020
на канале: 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  .


На этой странице сайта вы можете посмотреть видео онлайн Writing a code program in Python using While loop and if statement | Python for beginners in Hindi длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь ifactner 30 Декабрь 2020, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 245 раз и оно понравилось 7 зрителям. Приятного просмотра!