repl.it
@21natzil/

Debug Fixed

Python

The fixed version if the debugging example

fork
loading
Files
  • main.py
main.py
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)