Advertisement
Guest User

Challenge 2

a guest
Jul 5th, 2015
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.56 KB | None | 0 0
  1. h = 1
  2. parallel_list=[]
  3.  
  4. def create_function( a, b, c, d):
  5.     eq1 = str(a)+"x+"+str(b)
  6.     eq2 = str(c)+"x+"+str(d)
  7.     global h
  8.     couple = "couple"+str(h)
  9.     print("Your " + couple + " has two functions: " + eq1 + " and " + eq2)
  10.     h += 1
  11.     if a is c:
  12.         global parallel_list
  13.         parallel_list.append(couple)
  14.  
  15.  
  16. #that was the code; now I will write some examples to test the code
  17.  
  18. create_function(6,4,3,7)
  19. create_function(2,5,2,6)
  20. create_function(4,9,4,6)
  21. create_function(1,2,3,4)
  22. create_function(8,5,8,9)
  23.  
  24.  
  25. print(parallel_list)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement