diff --git a/README.md b/README.md index 2a39aa0b..818cf4e2 100644 --- a/README.md +++ b/README.md @@ -125,6 +125,8 @@ written correctly. - [Mathematics](src/standard_libraries/test_math.py) (`math`, `random`, `statistics` libraries) - [Dates and Times](src/standard_libraries/test_datetime.py) (`datetime` library) - [Data Compression](src/standard_libraries/test_zlib.py) (`zlib` library) +12. **User input** + - [Terminal input](src/user_input/test_input.py) from users to interact with the program ## Prerequisites diff --git a/src/user_input/test_input.py b/src/user_input/test_input.py new file mode 100644 index 00000000..a567d96f --- /dev/null +++ b/src/user_input/test_input.py @@ -0,0 +1,17 @@ +"""User input + +# @see https://docs.python.org/3/library/functions.html#input + +User input prompts are very helpful when it comes to interactive programming. Not only in games but also in standard file operations, you may want your user to interact with the program. +Therefore, the user needs the opportunity to be able to put in information. +""" + + +def user_input(): + """Input prompt""" + + """Printing statement to signal the user that we are waiting for input""" + user_input = input("Please type in your name.\n") + + """Printing a message based on the input""" + print(f"Welcome, {user_input}!")