⚡ 60 segundos
strings
Debug rápido com f-string e = (Python 3.8+)
Adicione = depois da variável na f-string para imprimir nome e valor. Perfeito para debug rápido.
fstring_debug.py
nome = 'Ana'
idade = 25
lista = [1, 2, 3]
# Antes: print(f'nome={nome}, idade={idade}')
# Com = (Python 3.8+)
print(f'{nome=}') # nome='Ana'
print(f'{idade=}') # idade=25
print(f'{len(lista)=}') # len(lista)=3
print(f'{lista[0]=}') # lista[0]=1