# myExample.py at root folder # 4 user inputs() ## string variables ## fname, lname fname = input("Enter your first name: ") lname = input("Enter your last name: ") ## int variable ## age age = int( input("Enter your age: ") ) ''' Method 2 i_age = input("Enter your age: " ) age = int(i_age) Method 3 Leave age as string and use f" {age}" output or param(lname, age) ''' ## boolean variable ## status status = input("Active Customer? (Yes/No): ") if status == "Yes": status = True else: status = False print( type(status)) # bool print(status) # define a function that uses all 4 ## print() a string for the output ## fname, lname, age, status ## function name: contact_info def contact_info(fname, lname, age, status): var_fname = fname var_lname = lname var_age = age var_status = status # Method 1 print(f"First Name: {var_fname} Last Name: {var_lname} Age: {var_age} Status: {var_status}") # Method 2 print("First Name: " + var_fname + " Last Name: " + var_lname + " Age: " + str(var_age) + " Status: " + str(var_status)) # Method 4 (using a string variable) result = "First Name: " + var_fname + " Last Name: " + var_lname + " Age: " + str(var_age) + " Status: " + str(var_status) print(result) # call the function and pass the 4 user inputs() contact_info(fname, lname,age, status) # 4 args from the user input() # define a function for a list of orders for the user ## orderids = [20, 21, 22, 23, 24] ## use a for loop in the scope of the function to print the individual order id def customer_orders(): orderids = [20, 21, 22, 23, 24] for orderid in orderids: print(f"Order ID: {orderid}") # call the orderid function customer_orders() # Method 2 pass the list as an arg>param orderids_2 = [20, 21, 22, 23, 24] def customer_orders_2(p_orderids_2): var_orderids = p_orderids_2 for orderid in var_orderids: print(f"Order ID: {orderid}") customer_orders_2(orderids_2) def customer_report(fname, lname, age, status): # No constructors # All this is doing is passing data print("--- Customer Data ---") contact_info(fname, lname, age, status) print() print("--- Customer Order Info ---") customer_orders() customer_report(fname, lname, age, status)