loading

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.6361981004550892","path":"main.py","file":{"path":"main.py","content":{"asEncoding":{"base64":"ZGVmIHByaW50X21lbnUoKToKICBwcmludCgnMS4gS2lsb21ldGVyIC0+IE1ldGVyJykKICBwcmludCgnMi4gTWV0ZXIgLT4gS2lsb21ldGVyJykKICBjaG9pY2UgPSBpbnB1dCgnS29udmVyc2kgbWFuYSB5YW5nIEFuZGEgbWF1ICgxLzIpPyAnKQogIHJldHVybiBjaG9pY2UKCmRlZiBrbV90b19tKCk6CiAgbnVtID0gZmxvYXQoaW5wdXQoJ0JlcmFwYSBraWxvbWV0ZXI/ICcpKQogIHJldHVybiAnezB9bScuZm9ybWF0KG51bSAqIDEwMDApCgpkZWYgbV90b19rbSgpOgogIG51bSA9IGZsb2F0KGlucHV0KCdCZXJhcGEgbWV0ZXI/ICcpKQogIHJldHVybiAnezB9a20nLmZvcm1hdChudW0gLyAxMDAwKSAgCgoKaWYgX19uYW1lX18gPT0gJ19fbWFpbl9fJzoKICB3aGlsZSBUcnVlOgogICAgY2hvaWNlID0gcHJpbnRfbWVudSgpCiAgICByZXMgPSAwCiAgICBpZiBjaG9pY2UgPT0gJzEnOgogICAgICByZXMgPSBrbV90b19tKCkKICAgIGVsaWYgY2hvaWNlID09ICcyJzoKICAgICAgcmVzID0gbV90b19rbSgpCgogICAgcHJpbnQoJ0hhc2lsbnlhIHswfScuZm9ybWF0KHJlcykpCgogICAgYW5zID0gaW5wdXQoJ1VsYW5naT8gKHkvbikgJykKICAgIGlmIGFucyA9PSAnbic6CiAgICAgIGJyZWFrCg=="},"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
25
26
27
28
29
30
def print_menu():
  print('1. Kilometer -> Meter')
  print('2. Meter -> Kilometer')
  choice = input('Konversi mana yang Anda mau (1/2)? ')
  return choice

def km_to_m():
  num = float(input('Berapa kilometer? '))
  return '{0}m'.format(num * 1000)

def m_to_km():
  num = float(input('Berapa meter? '))
  return '{0}km'.format(num / 1000)  


if __name__ == '__main__':
  while True:
    choice = print_menu()
    res = 0
    if choice == '1':
      res = km_to_m()
    elif choice == '2':
      res = m_to_km()

    print('Hasilnya {0}'.format(res))

    ans = input('Ulangi? (y/n) ')
    if ans == 'n':
      break