>>> import turtle
>>> wn=turtle.Screen()
>>> wn.setup(weight=800,height=600)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: setup() got an unexpected keyword argument 'weight'
>>> wn.setup(width=800,height=600)
>>> wn.bgcolor("black")
>>> pad=turtle.Turtle()
>>> pad.penup()
>>> pada=turtle.Turtle()
>>> pada.penup()
>>> pad.color("blue")
>>> pad.shape("square")
>>> pad.speed(0)
>>> pad.shapesize(stretch_wid=5,stretch_len=1)
>>> pad.goto(-350,0)
>>> pada.color("red")
>>> pada.shape("square")
>>> pada.shapesize(stretch_wid=5,stretch=len=1)
File "<stdin>", line 1
pada.shapesize(stretch_wid=5,stretch=len=1)
^
SyntaxError: invalid syntax
>>> pada.shapesize(stretch_wid=5,stretch_len=1)
>>> pada.goto(350,0)
>>>
>>> #FUNCIONES DE MOVIMIENTO DE pad Y pada
...
>>> def pad_up():
... y=paddle.ycor()
File "<stdin>", line 2
y=paddle.ycor()
^
IndentationError: expected an indented block
>>> def pad_up():
... y=pad.ycor()
... y+=20
... pad.sety(y)
...
>>> def pad_down():
... y=pad.ycor()
... y-=20
... pad.sety(y)
...
>>> wn.listen()
>>> wn.onkeypress(pad_up, "w")
>>> wn.onkeypress(pad_down, "s")
>>>
>>> def pada_up():
... y=pada.ycor()
... y+=20
... pada.sety(y)
...
>>> def pada_down():
... y=pada.ycor()
... y-=20
... pada.sety(y)
...
>>> wn.onkeypress(pada_up, "Up")
>>> wn.onkeypress(pada_down, "Down")
>>>
>>> #BORDES DE LA PANTALLA/LÍMITES
...
>>> ball=turtle.Turtle()
>>> ball.shape("circle")
>>> ball.penup()
>>> ball.color("white")
>>> ball.speed(0)
>>>
>>> While True:
File "<stdin>", line 1
While True:
^
SyntaxError: invalid syntax
>>> while True:
... #MOVIMIENTO DE LA BOLA
... ball.setx(ball.xcor()+ball.dx)
... ball.sety(ball.ycor()+ball.dy)
... if ball.ycor()>290:
... ball.sety(290)
... ball.dy*=-1
...
Traceback (most recent call last):
File "<stdin>", line 3, in <module>
AttributeError: 'Turtle' object has no attribute 'dx'
>>>