Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
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)
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}")
Add a comment
You probably intended:
print(symbol, "5 Day's Average Sales:", gy, file=file)
The write function takes a string.
write
Required, but never shown
By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.