-
Notifications
You must be signed in to change notification settings - Fork 0
Chapter 8
Jarlin Almanzar edited this page Nov 22, 2019
·
3 revisions
def greet_user():
"""Display a simple greeting"""
print("Hello!")
greet_user()
def greet_user(*names):
"""Display a simple greeting with names"""
print(*names)
greet_user('Jarlin', 'Billy')
def greet_user(name, age, **user_info):
"""Create and display a dict"""
user_info['user_name'] = name
user_info['user_age'] = age
print(user_info)
greet_user('Jarlin', 'Billy')
A module is a file ending in .py that contains the code you want to import into your program.
An import statement tells python to make the code in a module available in the currently running program.
example: name_of_file.py
import name_of_file
# How to use
name_of_file.name_of_method()
from name_of_file import *