0

I was trying to make a game in pygame but it was showing me an error. The error is:

(square_width*6,square_height*2))
TypeError: integer argument expected, got float

Please help me in solving this problem

3
  • 4
    add more source. Commented Sep 16, 2019 at 16:02
  • 3
    Please provide a little more of the code for us to look over. Are those parameters to a function? Is that a variable assignment? Why is there a comma between them? How were square_width and square_height given values? Commented Sep 16, 2019 at 16:02
  • Hello @ArnavAvuturu and welcome to Stack Overflow! You have provided very little information and, despite the fact that you have an answer here, you should add more context to get good results on this site for your future questions. Could you add: 1. The code you use to get this error, and 2. The FULL error traceback? By providing this kind of information we will be able to help you solve more and more complex issues, without this information all we can do is guess, which only really works for simple cases. Commented Sep 16, 2019 at 16:11

1 Answer 1

2

with not so much code and info given, the best answer to this question is:

replace your code with this. Since your code is raising a type error, then you gave wrong input. change your input to int instead of float

(int(square_width*6),int(square_height*2))
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.