Fakultas Ilmu Komputer UI
Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Ruly Achmad Gemilang Gultom
1906399915-DDP1
Commits
c2f89717
Commit
c2f89717
authored
Mar 30, 2020
by
Ruly Achmad Gemilang Gultom
Browse files
Tugas Pemrograman Ekstra Soal 1 - 1906399915
parent
96b27352
Changes
1
Hide whitespace changes
Inline
Side-by-side
TPEkstra_1_1906399915.py
0 → 100644
View file @
c2f89717
try
:
a
=
int
(
input
(
"masukkan bilangan pertama: "
))
b
=
int
(
input
(
"masukkan bilangan kedua: "
))
c
=
int
(
input
(
"masukkan bilangan ketiga: "
))
lis
=
[
a
,
b
,
c
]
lis
.
sort
()
print
(
lis
)
d
=
a
**
2
e
=
b
**
2
f
=
c
**
2
g
=
(
d
+
e
)
**
0.5
h
=
(
d
+
f
)
**
0.5
i
=
(
d
+
g
)
**
0.5
j
=
(
e
+
f
)
**
0.5
k
=
(
e
+
g
)
**
0.5
l
=
(
f
+
g
)
**
0.5
a1
=
(
d
-
e
)
**
0.5
a2
=
(
d
-
f
)
**
0.5
a3
=
(
d
-
g
)
**
0.5
a4
=
(
e
-
f
)
**
0.5
a5
=
(
e
-
g
)
**
0.5
a6
=
(
f
-
g
)
**
0.5
#samasisi
if
a
==
b
==
c
:
print
(
"segitiga sama sisi"
)
#samakaki
elif
a
==
b
or
a
==
c
or
b
==
c
:
print
(
"segitiga samakaki"
)
#Siku-siku
elif
g
==
a
or
g
==
b
or
g
==
c
or
a1
==
a
or
a1
==
b
or
a1
==
c
:
print
(
"segitiga siku2"
)
elif
h
==
a
or
h
==
b
or
h
==
c
or
a2
==
a
or
a2
==
b
or
a2
==
c
:
print
(
"segitiga siku2"
)
elif
i
==
a
or
i
==
b
or
i
==
c
or
a3
==
a
or
a3
==
b
or
a3
==
c
:
print
(
"segitiga siku2"
)
elif
j
==
a
or
j
==
b
or
j
==
c
or
a4
==
a
or
a4
==
b
or
a4
==
c
:
print
(
"segitiga siku2"
)
elif
k
==
a
or
k
==
b
or
k
==
c
or
a5
==
a
or
a5
==
b
or
a5
==
c
:
print
(
"segitiga siku2"
)
elif
l
==
a
or
l
==
b
or
l
==
c
or
a6
==
a
or
a6
==
b
or
a6
==
c
:
print
(
"segitiga siku2"
)
#bukan segitiga
elif
lis
[
0
]
+
lis
[
1
]
<=
lis
[
2
]:
print
(
"bukan segitiga"
)
else
:
print
(
"segitiga sembarang"
)
except
ValueError
:
print
(
"input bukan angka"
)
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment