Prof_Carvalho

Untitled

Feb 2nd, 2022 (edited)
747
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.26 KB | None | 0 0
  1. import requests
  2. cep = input('Informe seu CEP:')
  3. URL = f'https://viacep.com.br/ws/{cep}/json/'
  4. resposta = requests.get(URL)
  5. dados = resposta.json()
  6. print(f'''Sua Rua: {dados['logradouro']}
  7.          Seu Estado: {dados['uf']}
  8.          Seu DDD:{dados['ddd']}''')
Advertisement
Add Comment
Please, Sign In to add comment