elena_gancedo

Happy Birthday

Aug 5th, 2019
989
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.87 KB | None | 0 0
  1. # Challenge 2
  2. import turtle
  3. elena = turtle.Turtle()
  4.  
  5. elena.penup()
  6. def line(words, horiz_pos = -20):
  7.     x,y = elena.pos()
  8.     elena.goto(max(horiz_pos, -40), y)
  9.     elena.write(words)
  10.     x,y = elena.pos()
  11.     elena.goto(x, y -20)
  12.  
  13. def by():
  14.     elena.color('white')
  15.     x,y = elena.pos()
  16.     elena.goto(x + 70, max( -100, y -30))
  17.     elena.write()
  18.     x,y = elena.pos()
  19.     elena.goto(0, y)
  20.     name = input("Write down the name of the person you are going to congratulate: ")
  21.     return name
  22. name = by()
  23. elena.color('indigo')
  24. elena.goto(-50, 150)
  25. line("Happy Birthday to You,")
  26. line("Happy Birthday to You")
  27. line("Happy Birthday Dear " + name)
  28. line("Happy Birthday to You.")
  29.  
  30. elena.color('magenta')
  31. elena.goto(-50, 50)
  32. line("From good friends and true,")
  33. line("From old friends and new,")
  34. line("May good luck go with you,")
  35. line("And happiness too.")
Advertisement
Add Comment
Please, Sign In to add comment