Skip to content

Python code snippet – How to save inputs ?

#this is a getname command for example

# Function gets name from user
def get_name():
    print("Hello what is your name?")
    name = input("My name is: ")
    print("Hello ", name)
    return name
#  you can use the name as a variable in prints
print(name, 'you did very well')
#pls upvote
See also  Python code snippet - How to redefine a legend in pandas?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.