GoConqr has a new look! Let us know what you think.

Notes

PYTHON

Stheffanny Alves Portuguese 1 page

Content of the notes (1)

Page 1

TIPOS EMBUTIDOS

"""

https://docs.python.org/pt-br/3/library/stdtypes.html

Imutáveis que vimos: str, int, float, bool

"""

string = '1000'

# outra_variavel = f'{string[:3]}ABC{string[4:]}'

# print(string)

# print(outra_variavel)

print(string.zfill(10))

WHILE

"""

Repetições

while (enquanto)

Executa uma ação enquanto uma condição for verdadeira

Loop infinito -> Quando um código não tem fim

"""

condicao = True

while condicao:

nome = input('Qual o seu nome: ')

print(f'Seu nome é {nome}')

if nome == 'sair':

break

print('Acabou')

OUTRO CÓDIGO COM WHILE

contador = 0

while contador <= 10:

contador = contador + 1

print(contador)

print('Acabou')

Repetições

while (enquanto)

Executa uma ação enquanto uma condição for verdadeira

Loop infinito --> Quando um código não tem fim

"""

contador = 0

while contador <= 100:

contador += 1

if contador == 6:

print('Não vou mostrar o 6.')

continue

if contador >= 10 and contador <= 27:

print('Não vou mostrar o', contador)

continue

print(contador)

if contador == 40:

break

print('Acabou')

Information

Description
Note on PYTHON, created by Stheffanny Alves on 14/10/2024.
Created by
Stheffanny Alves · Oct 2024
Updated
Oct 15, 2024
Views
0
Rating

Feedback

What is it about?

What do you think of the new look?

How do you like it?