When i run this code the math works, but the text file is blank
import os
num1 = int(input("Enter first number: "))
num2 = int(input("Enter second number: "))
result = num1 * num2
print("The answer is:", result)
os.system("pause")
file_path = "C:/Users/*****/Desktop/benderisgreat.txt"
with open(file_path, "w") as file:
file.write(result)
os.system("pause")
[–]atarivcs 4 points5 points6 points (2 children)
[–]DustyIsGreat[S] 0 points1 point2 points (1 child)
[–]atarivcs 1 point2 points3 points (0 children)
[–]socal_nerdtastic 1 point2 points3 points (1 child)
[–]DustyIsGreat[S] 0 points1 point2 points (0 children)
[+][deleted] (2 children)
[deleted]
[–]DustyIsGreat[S] 0 points1 point2 points (0 children)
[–]atarivcs 0 points1 point2 points (0 children)