First ask the user what shape is wanted ... shape = input("What shape do you want (triangle, square and rectangle): ")
Once the shape is given, follow it with a conditional statement like ...

if shape == "rectangle":
a = float(input("Enter length of side a: "))
b = float(input("Enter length of side b: "))
# now do your area calculation and show result

You could use a function for the area calculation and pass arguments a and b to this function and return the area from the function.