2021年5月4日星期二

Not able to call definition

I'm trying to call a definition statement if an input is equal to "Y". However, it's saying my input is not defined. I just want to be able to call the same definition of "invoice_inputs" over and over again if the input is equal to "Y". The if statement with this problem is at the bottom of the code where it says "if additional_invoice == 'Y':"

import tkinter as tk  from math import *    order_number_list = []   quantity_list = []  price_list = []         intro_input = input("Would you like to create an invoice? (Y/N): ")  print(intro_input)    def invoice_inputs():    name_input = input("Enter your full name: ")    date_input = input("Enter today's date (mm/dd/yyyy): ")    order_number = float(input("Enter your order number: "))    product_quantity = float(input("Enter the quantity of product ordered: "))    product_price = float(input("Enter the price of the product($): "))    total_price = (product_quantity * product_price)        additional_invoice = input("Would you like to create an additional invoice? (Y/N): ")        round(total_price,2)      order_number_list.append(order_number)    quantity_list.append(product_quantity)    price_list.append(product_price)        if intro_input == "Y":    invoice_inputs()    if additional_invoice == "Y":        invoice_inputs()    elif intro_input != "Y":    print("Thank you for your time.")      
https://stackoverflow.com/questions/67393957/not-able-to-call-definition May 05, 2021 at 09:08AM

没有评论:

发表评论