0% found this document useful (0 votes)
19 views7 pages

5.2 Loops For

The document discusses Python range functions and provides examples of using range to control for loops. It also shows an example of using a while loop with a password input.

Uploaded by

muhammetnur
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views7 pages

5.2 Loops For

The document discusses Python range functions and provides examples of using range to control for loops. It also shows an example of using a while loop with a password input.

Uploaded by

muhammetnur
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 7

Gaýtalamalar

>>> print(*range(10))
0 1 2 3 4 5 6 7 8 9

>>> print(*range(4, 10))


4 5 6 7 8 9

>>> print(*range(4, 10, 2))


4 6 8
Gaýtalamalar
for i in range(10): 0
print(i) 1
2
.
.
7
8
9
Gaýtalamalar
for i in range(4, 10): 4
print(i) 5
6
7
8
9
Gaýtalamalar
for i in range(4, 10, 2): 4
print(i) 6
8
Mysallar
1) 2) 3) 4)
* ***** 1 -- 1 9
** **** 2 -- 4 8
*** *** 3 -- 9 7
**** ** 4 -- 16 6
***** * 5 -- 25 5
4
3
while True:
password = input("Açarsöz ýazyň: ")

if not password:
pass

elif len(password) in range(3, 9):


print("Täze açarsöz:", password)
break

else:
print("Açarsöz 3 we 8 karakter arasynda bolmalydyr.")

You might also like