سلام خسته نباشید
چرا در دقیقه ی ۵:۴۰ استاد توی شرط از return استفاده کردند؟
یعنی به این صورت:
def get_user_choice(): user_input = input("Please enter your choice (r, p, s): ") if user_input not in GAME_CHOICES: print("Please enter the right choice!!!") return get_user_choice() return user_input
من چیزی که احساس میکنم اینه که کد باید اینطوری نوشته میشد
def get_user_choice():
user_input = input("Please enter your choice (r, p, s): ")
if user_input not in GAME_CHOICES:
print("Please enter the right choice!!!")
get_user_choice()
return user_input
البته هر دوتاش کار میکنن
فقط منطق به کار بردن return رو اینجا متوجه نشدم.