I'm new to functions and arguments (actually new to python in general) and I'm having a bit of a problem making this program multiply the unit given by the user and output it. It just keeps coming up as whatever the variable is up top, and if I don't include that it says it isn't defined. May someone help, please?
# Variables
inches = 0
item_length = 0
unit_value = 0
# Your unit (smooots for general purposes) function
def inches_to_smoots(inches):
## inches = item x unit value
inches = item_length * unit_value
## return the number of inches
return inches
## main function
def main():
unit = input("What is the name of your unit? ")
unit_value = input (str("What is the length of your unit in inches? "))
item = input("What is the name of the object you'd like to convert to your unit? ")
item_length = input ("What is the length of your item in inches? ") # Is there a way to print a variable inside an input statement?
answer = inches_to_smoots(item_length)
## print the answer
print(item_length,'inches is', inches, unit, 's!')
## call main
main()