По итогу у меня вышел код :
import random
import math
def step(a):
a=float(a)
T=a**3
return(T)
p=random.choice(list("123456789"))
count=int(input("count\n"))
out=open("f.txt","w")
for x in range(count):
p=random.choice(list("123456789"))
out.write(p+"")
out.close()
out=open("output.txt")
r=out.read()
out.close()
o=r.split()
out=open("output.txt.","w")
for i in range(count):
s=step(r)
out.write(str(s)+"")
out.close()
input("Press ENTER to exit")
В результате у меня выдает ошибку :
Traceback (most recent call last):
File “C:\Users\ASTRA137\Desktop\Учёба\Программирование\Задание 16\Zadanie_16_Variant_11.py”, line 26, in <module>
s=step(r)
IndexError: string index out of range