Python Forum
[split] TypeError: 'int' object is not callable
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[split] TypeError: 'int' object is not callable
#1
I am new to programming and i have a threat that is Turple is not callable how can i solve it. Also, i cant figure out how to color my polygon using the if statment.
here is my code:

import turtle

turtle.Screen()

alex=turtle.Turtle()


n=int(input('please enter the number of polygon sides: '))
length=float(input('Give me the length of the side in pixels: '))
alex=turtle.Turtle()

alex.pencolor('red')
alex.pencolor('green')
i=n
for i in range(n):

alex.forward(length)
alex.left(360/n)



if ( i%2==0):
alex.pencolor('green')
print('i love you')

else:
alex.pencolor('red')
print('i hate you')

User has been warned for this post. Reason: Hijacked thread, No BBcode
Reply
#2
Welcome to the forum. Before you post again, please take time to read forum rules/help pages.
Don't hijack other user's threads. Start new thread for your own question.

Please, use proper tags when post code, traceback, output, etc.
See BBcode help for more info.

Please, post the entire traceback that you get. We need to see that whole thing. Do not just give us the last line.
Take a time to read What to include in a post
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  TypeError: cannot pickle ‘_asyncio.Future’ object Abdul_Rafey 1 385 Mar-07-2024, 03:40 PM
Last Post: deanhystad
  error in class: TypeError: 'str' object is not callable akbarza 2 504 Dec-30-2023, 04:35 PM
Last Post: deanhystad
Bug TypeError: 'NoneType' object is not subscriptable TheLummen 4 738 Nov-27-2023, 11:34 AM
Last Post: TheLummen
  TypeError: 'NoneType' object is not callable akbarza 4 988 Aug-24-2023, 05:14 PM
Last Post: snippsat
  [NEW CODER] TypeError: Object is not callable iwantyoursec 5 1,346 Aug-23-2023, 06:21 PM
Last Post: deanhystad
  Need help with 'str' object is not callable error. Fare 4 826 Jul-23-2023, 02:25 PM
Last Post: Fare
  TypeError: 'float' object is not callable #1 isdito2001 1 1,075 Jan-21-2023, 12:43 AM
Last Post: Yoriz
  TypeError: a bytes-like object is required ZeroX 13 4,090 Jan-07-2023, 07:02 PM
Last Post: deanhystad
  'SSHClient' object is not callable 3lnyn0 1 1,168 Dec-15-2022, 03:40 AM
Last Post: deanhystad
  TypeError: 'float' object is not callable TimofeyKolpakov 3 1,437 Dec-04-2022, 04:58 PM
Last Post: TimofeyKolpakov

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020