Created
April 14, 2022 07:00
-
-
Save triyono777/a9bd9a9bd1e96e70bb3a7828bef39e85 to your computer and use it in GitHub Desktop.
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
""" | |
buatlah program sederhana | |
dihitung pake for | |
user memasukkan harga barang | |
user memasukkan total barang | |
lalu print total harga barang | |
bisa pakai operator += | |
contoh: outputnya | |
total barang: 30 | |
harga barang: 5000 | |
150000 | |
""" | |
harga_barang = int(input('harga barang: ')) | |
barang = int(input('total barang: ')) | |
total_harga= 0 | |
for i in range(barang): | |
# total_harga = total_harga + harga_barang | |
total_harga += harga_barang | |
print('total harga',total_harga) | |
print(total_harga) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment