dudung / python

a python cookbook
MIT License
0 stars 23 forks source link

Latihan 25 Maret 2023 -- examples #7

Closed dudung closed 1 year ago

dudung commented 1 year ago

Silakan mencoba contoh terintegrasi numbers yang diberikan dengan memberikan komentar di bawah ini.

dwy-prasat commented 1 year ago
flowchart LR
  B --> I --> P --> O --> E
  B(("Begin"))
  I[/"read x, y"/]
  P["z = x - y"]
  O[/"display z"/]
  E(("End"))
nilampuspita commented 1 year ago
flowchart TD
  B --> I --> D
  D --Y--> C1a
  D --N--> C2a
  C1b --> P1 --> O
  C2b --> P2 --> O
  O --> E
  C1a(("1"))
  C1b(("1"))
  C2a(("2"))
  C2b(("2"))
  B(("Begin"))
  I[/"x"/]
  D{"x > 0?"}
  P1["msg = 'Bilangan Negatif'"]
  P2["msg = 'Bilangan Positif'"]
  O[/"x is msg"/]
  E(("End"))
aad169 commented 1 year ago
flowchart TB
B --> I --> D --Y--> O1 --> E
                  D --N-->O2 --> E
B(("Begin"))
I[/"Input"/]
O1[/"Kelipatan 2"/]
O2[/"Bukan kelipatan 2"/]
E(("End"))
D{"Apakah kelipatan 2?"}
# begin

# input
x = int(input("Input angka : "))

# decision
if x % 2 == 0:
  # process 1
  msg = "Angka kelipatan 2"
else:
  # process 2
  msg = "Bukan kelipatan 2"

# ouput
print(x, "adalah", msg)

# end
aliefpascal commented 1 year ago
flowchart LR
  B --> I --> P --> O --> E
  B(("Start"))
  I[/"read x, y"/]
  P["z = x - y"]
  O[/"display z"/]
  E(("End"))

begin

input

x = float(input("x = ")) y = float(input("y = "))

process

z = x - y

output

print("z = x - y =", z)

end

inassuha commented 1 year ago
flowchart LR
  B --> I --> O --> E
  B(("Begin"))
  I[/"read x"/]
  O[/"display x"/]
  E(("End"))
zains2itbdatascience commented 1 year ago
flowchart LR
  B --> I --> O --> E
  B(("Begin"))
  I[/"read x"/]
  O[/"display x"/]
  E(("End"))
flowchart LR
  B --> I --> P --> O --> E
  B(("Begin"))
  I[/"read x, y"/]
  P["z = x - y"]
  O[/"display z"/]
  E(("End"))
flowchart TD
  B --> I --> D1 --Y--> C1a
  D1 --N--> C2a
  C1b --> P1 ---> C3a
  C2b --> D2 --Y--> P2
  D2 --N--> P3
  P2 & P3 --> C3a
  C3b --> O --> E
  C1a(("1"))
  C1b(("1"))
  C2a(("2"))
  C2b(("2"))
  C3a(("3"))
  C3b(("3"))
  B(("Begin"))
  I[/"x"/]
  D1{"x < 0"}
  D2{"x > 0"}
  P1["msg = 'negative'"]
  P2["msg = 'positive'"]
  P3["msg = 'zero'"]
  O[/"x is msg"/]
  E(("End"))
ghafuraws commented 1 year ago
flowchart TD
  B --> I --> D
  D --Y--> C1a
  D --N--> C2a
  C1b --> P1 --> O
  C2b --> P2 --> O
  O --> E
  C1a(("1"))
  C1b(("1"))
  C2a(("2"))
  C2b(("2"))
  B(("Begin"))
  I[/"x, y"/]
  D{"x < y?"}
  P1["sign = '<'"]
  P2["sign = '>='"]
  O[/"x sign y"/]
  E(("End"))
galiharisona commented 1 year ago
flowchart LR
  B --> I --> O --> E
  B(("Mulai"))
  I[/"Penjumlahan x+y"/]
  O[/"tampilkan hasil penjumlahan"/]
  E(("Akhir"))
veralaksa commented 1 year ago
vera elysa
flowchart TD
  B --> I --> D
  D --Y--> C1a
  D --N--> C2a
  C1b --> P1 --> O
  C2b --> P2 --> O
  O --> E
  C1a(("1"))
  C1b(("1"))
  C2a(("2"))
  C2b(("2"))
  B(("Mulai"))
  I[/"V, T"/]
  D{"V < T?"}
  P1["sign = '<'"]
  P2["sign = '>='"]
  O[/"v sign t"/]
  E(("Selesai"))
Yaksuwa commented 1 year ago
flowchart LR
  B --> I --> P --> O --> E
  B(("Start"))
  I[/"Masukkan x, y"/]
  P["z = x - y"]
  O[/"Hasilnya z"/]
  E(("End"))
afinsani commented 1 year ago

#MENGHITUNG LUAS PERSEGI PANJANG
#AKHMAD FAEDA INSANI

# INPUT PANJANG & LEBAR
p = float(input('input panjang: '))
l= float(input('input lebar: '))

#PROCESS--> HITUNG LUAS
luas = p * l

#OUTPUT-->TAMPILKAN HASIL PERHITUNGAN
print('Luas Persegi Panjang %0.2f' %luas)


flowchart LR
  B --> I --> P-->O-->E

  B(("MULAI"))
  I[/"INPUT :  float p & l"/]
  P["HITUNG LUAS = p * l"]
  O[/"DISPLAY "LUAS""/]
  E(("SELESAI"))
adityaadiaksa commented 1 year ago

begin

input

x = float(input("x = ")) y = float(input("y = "))

process

z = x - y

ouput

print("z = x - y =", z)

end

""" $ python substract.py x = 5 y = 7.2 z = x - y = -2.2 """

flowchart LR
  B --> I --> P --> O --> E
  B(("Begin"))
  I[/"read x, y"/]
  P["z = x - y"]
  O[/"display z"/]
  E(("End"))
eidelbert commented 1 year ago
flowchart LR
  B --> I --> P --> O --> E
  B(("Begin"))
  I[/"read a, b, c"/]
  P["x = (a*b)/c"]
  O[/"display x"/]
  E(("End"))