When I go to input 'T' or 't' to go into the triangle prompts, regardless of what I input, the program immediately goes into the calculation for circle.
When I change the IF statement to only accept one character, such as lowercase 't' or 'c' it works randomly, but I want to ensure that the user can input upper or lowercase.
What am I doing wrong? I am using python 2.
#This program calculates the area and other information for
geometric shapes
# python AreaCalculator.py
option = raw_input("Enter C for circle or T for triangle ")
print option #this is just to ensure the program is updating the
variable
if option == 'c' or 'C':
radius = float(raw_input("Enter the radius of your circle "))
area = 3.14159 * radius**2
print "The area of your circle is %f units" % (area)
elif option == 't' or 'T':
base = float(raw_input("Enter base "))
height = float(raw_input("Enter height "))
area = .5*base*height
print "The area of the triangle is %f units" % (area)
else:
print "Invalid"
print "Program complete, please come again"
The result from inputting T or t into option = raw_input just puts me into the if statement pertaining to the circle