Skip to main content

Command Palette

Search for a command to run...

2024-08-02: 2. Define Function

Updated

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)

More from this blog

达客宁

171 posts

江南有佳丽 生于帝王州 繁花未曾见 王谢纸上闻

茕茕影孑立 烟雨两凄迷 凭栏望楼台 四百寺安在