r/PythonLearning • • Aug 14 '25

Why I didn't getting default value

Post image
5 Upvotes

18 comments sorted by

View all comments

2

u/DevRetroGames Aug 15 '25
def _get_user_input(msg: str) -> str:
  return input(msg)

def _hello(to: str = "world") -> None:
  print(f"hello {to}")
  
def main() -> None:
  to:str = _get_user_input("What is your name? : ")
  _hello(to)
  
main()