Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random as rnd
- # Escritura sobre un archivo de texto:
- with open('python.txt', 'w', encoding='utf-8') as f:
- for idx in range(1, 11):
- f.write('{}\n'.format(idx))
- # Lectura del archivo de texto:
- with open('python.txt', 'r', encoding='utf-8') as f:
- for linea in f:
- print(linea, end='')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement