Reputation: 13
I am trying to output a variable with text in turtle but it always outputs the wrong thing im trying to write "point 1 (100, 100) where x1 = 100, y1 = 100
#writing the text
turtle.goto(point1)
turtle.write("point 1 (",x1",",y1,")")
Upvotes: 0
Views: 837
Reputation: 2379
You manipulated the quotation marks a bit wrongly. Try using f-strings
:
turtle.write(f"point 1 ({x1}, {y1})")
Upvotes: 1