loading

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.33382738310417626","path":"main.py","file":{"path":"main.py","content":{"asEncoding":{"base64":"ZGVmIG11bHRpcGxpY2F0aW9uX3RhYmxlKHJvdywgbnVtKToKCWZvciBpIGluIHJhbmdlKDEsIHJvdyArIDEpOgoJCXJlcyA9IGkgKiBudW0KCQlwcmludCgnezB9IHggezF9ID0gezJ9Jy5mb3JtYXQoIG51bSwgaSwgcmVzKSkKCmlmIF9fbmFtZV9fID09ICdfX21haW5fXyc6ICAKICAjIGphbGFuIHRlcnVzIHNhbXBhaSB1c2VyIHBpbGloIGJlcmVudGkKICB3aGlsZSBUcnVlOgogICAgIyBhbWJpbCBpbnB1dCBwZXJ0YW1hCiAgICBudW0gPSBpbnQoaW5wdXQoJ01hc3VraW4gYW5na2E6ICcpKQoKICAgICMgYW1iaWwgaW5wdXQga2VkdWEKICAgIHJvdyA9IGludChpbnB1dCgnQmVyYXBhIGJhcmlzOiAnKSkKCiAgICAjIHByaW50IGJhcmlzCiAgICBtdWx0aXBsaWNhdGlvbl90YWJsZShyb3csIG51bSkKICAgIAogICAgIyBvcHNpIGlzaSBhbmdrYSBiYXJ1IC8gYmVyZW50aQogICAgYW5zID0gaW5wdXQoJ0lucHV0IGFuZ2thIGxhaW46IHkvbiA/ICcgKQogICAgaWYgYW5zID09ICduJzoKICAgICAgIyBrZWx1YXIgZGFyaSBsb29wCiAgICAgIGJyZWFrCiAgICAK"},"asBuffer":null},"loaded":true}}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
def multiplication_table(row, num):
	for i in range(1, row + 1):
		res = i * num
		print('{0} x {1} = {2}'.format( num, i, res))

if __name__ == '__main__':  
  # jalan terus sampai user pilih berenti
  while True:
    # ambil input pertama
    num = int(input('Masukin angka: '))

    # ambil input kedua
    row = int(input('Berapa baris: '))

    # print baris
    multiplication_table(row, num)
    
    # opsi isi angka baru / berenti
    ans = input('Input angka lain: y/n ? ' )
    if ans == 'n':
      # keluar dari loop
      break