Python Forum

Full Version: Trying to compare string values in an if statement
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am doing a tutorial where i get some string data input

lbsOrKgs = input ("is it in lbs or kgs")

now after getting that input all i want to do is write a comparison

if lbsOrKgs == ("lbs) or lbsOrKgs = ("kgs"):
print ("cool)

Getting error? Please help me understand. Thank you.
== is comparison, = is assignment. Quotes come in pairs. Some of yours do not match up.

Please use python tags when posting code, otherwise the indenting is lost.