SHARE
TWEET

5q Prova de quarta

DomMisterSoja Sep 19th, 2018 81 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. binn=[]
  2. n=1
  3. while(n!=00):
  4.     n=int(input('Insira o numeros que devem ser convertidos para binario, digite 00 para encerrar.'))
  5.     if n!= 00:
  6.         x=bin(n)
  7.         print(x)
  8.         x=x[2:]
  9.         binn.append(x)
  10.     else:
  11.         z=0
  12. print(binn)
  13. arquivo=open('binario.txt','w')
  14. linha=''
  15. for i in binn:
  16.     linha+=(f'{i} \n')
  17. arquivo.writelines(linha)
  18. arquivo.close()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top