convert_with = input("What are you converting with?: ")
amount = float(input("How many",amount,"?: "))
convert_to = input("What are you converting to?: ")
Meter = 100
Decimeter = 10
Centimeter = 1
if convert_with == "Centimeter":
if convert_to == "Decimeter":
print(amount/10)
if convert_with == "Centimeter":
if convert_to == "Meter":
print(amount/100)
if convert_with == "Decimeter":
if convert_to == "Centimeter":
print(amount*10)
if convert_with == "Decimeter":
if convert_to == "Meter":
print(amount/10)
if convert_with == "Meter":
if convert_to == "Centimeter":
print(amount*100)
if convert_with == "Meter":
if convert_to == "Decimeter":
print(amount*10)
*error message: What are you converting with?: Centimeter
Traceback (most recent call last):
File "", line 2, in <module
NameError: name 'amount' is not defined
source https://stackoverflow.com/questions/70441126/name-amount-is-not-defined-error-message-python
Comments
Post a Comment