0
text = "Please enter your weight in", Measurement_system
weight = input(text)

I want to give the user a prompt for their input without it being enclosed in quotation marks

In response to the above code it displays:

('Please enter your weight in', 'imperial')

Does anyone know how to get rid of these quotation marks? Thanks :)

1 Answers1

5

Your text value is actually a tuple because you used a comma during assignment of text. Instead, concatenate the strings.

text = "Please enter your weight in " + Measurement_system
weight = input(text)

Or you could use string formatting (although it's a little overkill in this situation IMO):

text = "Please enter your weight in {}".format(Measurement_system)
weight = input(text)

Or, the older string formatting syntax

text = "Please enter your weight in %s" % Measurement_system
weight = input(text)
Kevin
  • 74,910
  • 12
  • 133
  • 166