Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- type, msg1, msg2 = input('Shape: '), 'Input 1: ', 'Input 2: '
- inp = [float(input(msg1)),None] if type in 'square / circle' else [float(input(msg1)), float(input(msg2))] if type in 'rectangle / triangle' else None
- print(f"Area of {type} is {round(inp[0]*inp[0],3) if type=='square' else round(inp[0]*inp[1],3) if type=='rectangle' else round(3.14159265359*inp[0]*inp[0],3) if type=='circle' else 0.5 * inp[0] * inp[1]}")
Add Comment
Please, Sign In to add comment