# Chapter4Modules.py # Here is where our defined functions will live # pass keyword allows us to create a function without an operation def customerInfo(first_name, last_name): """ FirstName, LastName, State """ full_name = first_name + ' ' + last_name # the last step of the scope is the return to the function return full_name # this will return the value of full_name when we call the customInfo() function. # print(full_name) def customerDetailInfo(): """ Phone, Fax, Email """ pass def orderInfo(): """ OrderID, OrderTotal """ pass def cartInfo(): """ BillToAddress, ShipToAddress""" pass def ccInfo(ccNum, ccExp, ccCVC, cartTotal): """ The return value for this function will be "Approved" or "Declined" """ # capture the data passed for the ccInfo # cartTotal good idea to create a local variable ct = cartTotal apiData = (ct,ccNum,ccExp,ccCVC) # credit card processor events creditLimit = 5000 # api parse overLimit = ct - creditLimit # use an if statement to return approved or declined if ct < creditLimit: return "Approved", ct else: return "Declined", overLimit