repl.it
@johnburk/

InexperiencedImaginaryProcedures

Python

No description

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
#This is pretty close to the code we wrote last time. It is a functiont that when given a point (x,y) tells you which quadrant (I, II, III or IV) contains that point

def Quadrant(x,y):
  if x < 0:
    if y > 0:
      return "I"
    else:
      return "IV"
  else:
    if y > 0:
      return "II"
    else:
      return "III"
print("The point (2,3) is in the "+ quadrant(2,3) + " quadrant")

#There is a bug in this code that prevents it from running. Can you fix it? 


#There is a bug in this program that doesn't prevent it from running, but does make it produce the wrong output. Can you fix it? 


#The point (0,3) isn't in any quadrant. What quadrant does our function say it is in? Can we modify our function so that it produces correct output for points along the axes?