Advertisement
Karasick

Untitled

Jun 15th, 2020
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.58 KB | None | 0 0
  1.  
  2. def dog_walk(x, y, say="", speed="normal"):
  3.     print(f"Dog {speed} walk to point ({x}, {y})", end=" ")
  4.     if say:
  5.         print(f"and say '{say}'", end=" ")
  6.     print()
  7.  
  8.  
  9. dog_walk(0, 0)
  10.     # Dog normal walk to point (0, 0)
  11.  
  12. dog_walk(0, 0, "Wuf!")
  13.     # Dog normal walk to point (0, 0) and say 'Wuf!'
  14.  
  15. dog_walk(0, 0, "Wuf!", "slow")
  16.     # Dog slow walk to point (0, 0) and say 'Wuf!'
  17.  
  18. dog_walk(0, 0, speed="fast")
  19.     # Dog fast walk to point (0, 0)
  20.  
  21. dog_walk(say="I am a WULF!", x=100, y=500)
  22.     # Dog normal walk to point (100, 500) and say 'I am a WULF!'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement