@21natzil/

Debug Fixed

Python

The fixed version if the debugging example

fork
loading
Files
  • main.py

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.31536012765517873","path":"main.py","file":{"path":"main.py","content":{"asEncoding":{"base64":"aW1wb3J0IHJlcXVlc3RzCgoKZGVmIGdldF9kYXRhKCk6CiAgd2l0aCByZXF1ZXN0cy5TZXNzaW9uKCkgYXMgc2Vzc2lvbjoKICAgIHdpdGggc2Vzc2lvbi5nZXQoZiJodHRwOi8vaHR0cGJpbi5vcmcvZW5jb2RpbmcvdXRmOCIpIGFzIHJlc3A6CiAgICAgIHJldHVybiByZXNwLmNvbnRlbnQuZGVjb2RlKCd1dGYtOCcpCgpkZWYgaGFuZGxlX21hdGgobWluX251bWJlcjogaW50LCBtYXhfbnVtYmVyOiBpbnQpOgogICAgaWYgbWF4X251bWJlciA9PSAwOgogICAgICBwcmludCgiVGhlIG1heCBudW1iZXIgY2Fubm90IGJlIDAiKQogICAgICByZXR1cm4KCiAgICBwcmludCgKICAgICAgZ2V0X2RhdGEoKVswXSAqIGludChtaW5fbnVtYmVyIC8gbWF4X251bWJlcikKICAgICkKICAgIHJldHVybiAobWluX251bWJlciAvIG1heF9udW1iZXIpICAgICAgCgpudW1iZXJzID0gWzAsIDEsIDIsIDNdCgpmb3IgaSBpbiBudW1iZXJzLmNvcHkoKToKICByID0gaGFuZGxlX21hdGgoNSwgaSkKICBudW1iZXJzLmluc2VydCgwLCByKQo="},"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
import requests


def get_data():
  with requests.Session() as session:
    with session.get(f"http://httpbin.org/encoding/utf8") as resp:
      return resp.content.decode('utf-8')

def handle_math(min_number: int, max_number: int):
    if max_number == 0:
      print("The max number cannot be 0")
      return

    print(
      get_data()[0] * int(min_number / max_number)
    )
    return (min_number / max_number)      

numbers = [0, 1, 2, 3]

for i in numbers.copy():
  r = handle_math(5, i)
  numbers.insert(0, r)