side1 = float(input("Side 1: "))
side2 = float(input("Side 2: "))
side3 = float(input("Side 3: "))
if side1 < side2 + side3 and side2 < side1 + side3 and side3 < side1 + side2: # triangle inequality theorem
# (any side of a triangle must be less than the sum of the other sides)
print("It is a triangle")
if side1 == side2 == side3:
print("Equilateral Triangle")
elif side1 != side2 and side1 != side3 and side2 != side3:
print("Scalene Triangle")
else:
print("Isosceles Triangle")
else:
print("It is not a triangle")
Created
March 16, 2025 22:17
-
-
Save miquelvir/6c7435bebd5750e9e923848d18dc6bd2 to your computer and use it in GitHub Desktop.
devQuest - 16/03/2025 23:17
character = ord(input("Enter a character (will crash if you enter more than one)"))
if ord('a') <= character <= ord('z'):
print('The letter', chr(character), 'is lowercase')
elif ord('A') <= character <= ord('Z'):
print('The letter', chr(character), 'is uppercase')
elif ord('0') <= character <= ord('9'):
print(chr(character), 'is a number')
else:
print(chr(character), 'is a symbol')
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment