teromakotero

Python_from_Scratch_13_ratkaisu

May 13th, 2019
394
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.65 KB | None | 0 0
  1. import turtle
  2. import background
  3. import time
  4. from random import shuffle
  5.  
  6. pycat = turtle.Turtle()
  7. pycat.hideturtle()
  8. screen = turtle.Screen()
  9. image = ()
  10. image = "pycat_200_px_left.png"
  11. screen.addshape(image)
  12. pycat.shape(image)
  13. pycat.showturtle()
  14. pycat.goto(0,0)
  15. pycat.penup()
  16.  
  17. # KIRJOITA TÄMÄN RIVIN ALAPUOLELLE OMA KOODISI
  18. nimet = []
  19. y = 0
  20. while True:
  21.   nimi = input("Anna nimi: ")
  22.   if(nimi == "sekoita"):
  23.     shuffle(nimet)
  24.     pycat.write("Sekoitetut:")
  25.     y -= 20
  26.     pycat.goto(0,y)
  27.     for i in nimet:
  28.       pycat.write(i)
  29.       y -= 10
  30.       pycat.goto(0,y)
  31.       pycat.hideturtle()
  32.     break
  33.   else:
  34.     nimet.append(nimi)
Advertisement
Add Comment
Please, Sign In to add comment