Need help with this code please


#1



this is not exactly on topic but i really need help with this code and i cant understand whats wrong with this code its showing an indentation error. please help


# this is a converter program
print "this is a converter program"
print "you can convert:"
print "length"
print "weight"
def converter():
     quantity = raw_input("please choose your desired quantity")
     if quantity == "length":
	     print "these are the units which you can use for conversion"
	     print "metre, centimetre"
	     unit_1 = raw_input("please choose the unit from which you would like to convert")
		 unit_2 = raw_input("please choose the unit to which you would like to convert")
		 value_1 = raw_input("please enter the numerical value for the first unit")
		 if unit_1 == "metre" and unit_2 == "centimetre":
		     print value_1 / 100
		 elif unit_1 == "centimetre" and unit_2 == "metre":
		     print value_1 * 100
		 else  
		     print "kindly choose the quantities and units which are specified":
			 converter()
	
	 elif quantity == "weight":
	     print "these are the units which you can use for conversion"
	     print "kilogram, gram"
	     unit_1 = raw_input("please choose the unit from which you would like to convert")
		 unit_2 = raw_input("please choose the unit to which you would like to convert")
		 value_1 = raw_input("please enter the numerical value for the first unit")
		 if unit_1 == "kilogram" and unit_2 == "gram":
		     print value_1 / 1000
		 elif unit_1 == "gram" and unit_2 == "kilogram":
		     print value_1 * 1000
		 else  
		     print "kindly choose the quantities and units which are specified":
			 converter()
     
   	 else:
	     print "kindly choose the quantities which are specified"
		 converter()
converter()


#2

What error are you receiving?


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.