Python tutorial for beginners in Hindi Urdu lesson 17 gives you introduction to For loops in Python programming. We learn what are for loops and what they are used for. Sometimes, we can perform the same task with for loop and while loop. At the end of this section of Python for beginners in Hindi Urdu tutorial, you will be better able to understand when to use while loop and when to use for loop in Python.
We write the following lines of codes to understand about for loops in Python:
For loop : iterates over a sequence of values
for charc in ('course'):
print(charc)
customers = ['Jan', 'Jane', 'Jon']
for customer in customers:
print('Hi! Weclome ' + customer)
numbers = [1, 2, 3, 4, 5]
for number in numbers:
print(number)
numbers = [1, 2, 3, 4, 5]
total = 0
for number in numbers:
total = total + number
print(total)
print('Your total is ' + str(total))
print(f"Your totoal is: {total}")
We also learn about lists in Python language.
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...
16. Writing a code program in Python using While loop and if statement | Python for beginners in Hindi at • Writing a code program in Python using Whi...
Full Python course in Hindi Urdu playlist at • Python programming course in Hindi Urdu .