after watching (Default Values for Arguments) ....playing with code

0 aleco Fl3x · September 11, 2015

print("Choose Left or Right: ")

def turn(choose='unknown'):
if choose.lower().startswith("l"):
choose = "Left"
elif choose.lower().startswith("r"):
choose = "Right"
return choose

user_input = input("> ")

print(turn(user_input))

so i haven't been coding for months and forgot how to code, so i had to re track my way around.
and after watching again a few tutorials i came u with this...
im learning a lot from you bucky :D 

Post a Reply

Replies

Oldest  Newest  Rating
0 Halcyon Abraham Ramirez · September 12, 2015
Nice!
  • 1

Python

106,992 followers
About

This section is all about snakes! Just kidding.

Links
Moderators
Bucky Roberts Administrator