'Expected type 'str', got 'tuple[int, int]' instead r_paddle = Paddle((350, 0)) takes only string not tuples, python version 3.10.4
from turtle import Screen
from paddle import Paddle
screen = Screen()
screen.bgcolor("black")
screen.setup(width=800, height=600)
screen.title("Pong game")
screen.tracer(0)
r_paddle = Paddle((350, 0)) *takes only string not tuples*
l_paddle = Paddle((-350, 0)) *takes only string not tuples*
game_is_on = True
while game_is_on:
screen.update()
screen.exitonclick()
Expected type 'str', got 'tuple[int, int]' instead. this appears when I run. But in previous versions (3.9) of python it works. Current version of python 3.10.4
from turtle import Turtle
class Paddle(Turtle):
def __int__(self, position):
super().__init__()
self.color("white")
self.shapesize(stretch_wid=1, stretch_len=5)
self.penup()
self.goto(position)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
