-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path14While.py
More file actions
38 lines (26 loc) · 966 Bytes
/
Copy path14While.py
File metadata and controls
38 lines (26 loc) · 966 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#Estrutura While
import os #library para manipular recursos do windows
os.system('cls') #Comando para o windows limpar o terminal
#inicializaçao de variavel de controle
i=0
while (i<9):
print(i)
i= i+1 ### IMPORTANTE ### SE ESQUECER ENTRA DENTRO DO LOOP INFINITO
print("fim do loop")
i=0
while (i<9):
print(i)
i= i+1 ### IMPORTANTE ### SE ESQUECER ENTRA DENTRO DO LOOP INFINITO
if i>=5:
break
print("fim do loop")
carros = ["Gol", "Palio", "Corsa", "Celta", "Fiesta", "Uno"]
tam = len(carros)
i = 0
while i <tam:
print(carros[i])
i+=1
carros = ["Volkswagen Gol", "Fiat Palio", "Chevrolet Onix", "Ford Fiesta", "Renault Kwid", "Toyota Corolla", "Honda Civic", "Hyundai HB20", "Nissan March", "Peugeot 208", "Volkswagen Polo", "Chevrolet Prisma", "Ford Ka", "Renault Sandero", "Toyota Yaris", "Honda Fit", "Hyundai Creta", "Nissan Versa", "Kia Rio", "Subaru Impreza"]
print(carros)
for x in carros:
print(x)