0

This is my code____

file.write(symbol, " 5 Day's Average Sales%: ", gy)

I'm getting this error___

TypeError: TextIOWrapper.write() takes exactly one argument (3 given)
0

2 Answers 2

1

You are parsing three arguments into the write function. symbol, " 5 Day's Average Sales%: ", gy

the write function only takes one string as a parameter try using an F-string

file.write(f"{symbol} 5 Day's Average Sales%: {gy}")
Sign up to request clarification or add additional context in comments.

Comments

0

You probably intended:

print(symbol, "5 Day's Average Sales:", gy, file=file)

The write function takes a string.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.