import random
x = 1
z = random.randint(0,255)
if x != z:
print('unsuccessful')
if x = z:
print('successful')
f = open("C:\Users\AsusTUF\ai.txt", "a")
del = text.replace('z = random.randint(0,255)','z = '
So i want to write value of z into the file, but I dont have an idea on how to do it! Thanks in advance for the help.
Keep in mind I am new to python so I tried return z but did not even run that because i know it wont work.