Created
November 3, 2017 20:16
-
-
Save bakialmaci/fe7a21ec6d0cc18d9a169981a01be0da to your computer and use it in GitHub Desktop.
Verifying Geometric Figures with PYTHON 3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def geometri(sekil): | |
if len(sekil) == 3: | |
a = sekil[0] | |
b = sekil[1] | |
c = sekil[2] | |
if(a+b)>c and (a+c)>b and (b+c)>a: | |
if(a==b) and (a==c) and (b==c): | |
print("eşkenar üçgen") | |
elif((a**2 + b**2) == c**2) or ((b**2 + c**2) == a**2) or ((a**2 + c**2) == b**2): | |
print("dik üçgen") | |
elif(a==b) or (b==c) or (a==c): | |
print("ikizkenar üçgen") | |
else: | |
print("çeşitkenar") | |
else: | |
print("üçgen belirmiyor!") | |
elif len(sekil) == 4: | |
a = sekil[0] | |
b = sekil[1] | |
c = sekil[2] | |
d = sekil[3] | |
if(a==b) and (a==c) and (a==d): | |
print("Kare") | |
elif((a==b) and (c==d)) or ((a==c) and (b==d)) or ((a==d) and (b==c)): | |
print("dikdörtgen") | |
else: | |
print("Dörtgen") | |
while(True): | |
elemansayisi = int(input("Eleman sayisi: ")) | |
if(elemansayisi==3): | |
a = int(input("a:")) | |
b = int(input("b:")) | |
c = int(input("c:")) | |
geometri([a,b,c]) | |
elif(elemansayisi==4): | |
a = int(input("a:")) | |
b = int(input("b:")) | |
c = int(input("c:")) | |
d = int(input("d:")) | |
geometri([a, b, c, d]) | |
else: | |
print("tekrar girin") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment