2024-08-02: 2. Define Function

YonnyYonny
1 min read

Another piece code when learning function

# Review:
# Create a function called greet().
def greet(name, location):
    # Write 3 print statements inside the function.
    print(f"Hello {name}!")
    print(f"Is {location} far?")
    print(f"Isn't the weather nice today in {location}? {name}")


# Call the greet() function and run your code.
your_name = input("What is your name? ")
your_location = input("Where do you live? ")
greet(name=your_location, location=your_name)
0
Subscribe to my newsletter

Read articles from Yonny directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Yonny
Yonny