Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from random import randint
- print("Проверка случайности функции \"randint\" из модуля \"random\" ")
- def RD():
- for rand in range(10000):
- print(randint(1, 100))
- file = open('rannd.txt', 'w')
- file = open('rannd.txt', 'a')
- file = open('rannd.txt', 'r')
- file.write(str(RD()))
- file1 = input("Открыть файл с 10000 случайных чисел в диапазоне от 1 до 100? Yes/No:")
- file1 = open('rannd.txt', 'r')
- if file1 == "No":
- print("Хорошо")
- elif file1 == "Yes":
- strings = file.readlines(10000)
- print( strings )
- file.readlines()
- print( strings )
- import os
- path = os.path.join(os.path.abspath(os.path.dirname(_file_)), 'rannd.txt')
- os.remove(path)
- input("\n\nНажмите Enter. чтобы выйти.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement