@m314n13/

assap

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
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
import colorama # learn more: https://python.org/pypi/colorama
from colorama import Fore, Back
# name: print_until
# purpose:
# input: integer
# returns:

def print_until(a):
  for i in range(0 , a):
    print(i+1)
print_until(7)



  
  
# name: compare_lists
# purpose:
# input: list1, list2
# returns:

def compare_lists(list1, list2):
  for i in range(0,len(list1)):
    if list1[i] > list2[i]:
      print(print(str(list1[i])))
    elif list2[i] > list1[i]: 
      print(str(list2[i]))
    else:
      print("They are the same: " + str(list1[i]))

  
# name: swapping_stars
# purpose:
# input: 
# returns:
def swapping_stars():
 for a in range(0,3):
   for i in range(0,3):
     if a % 2 == 0:
       print(Fore.RED + '* -  ', end= '')
     else:
       print(Fore.YELLOW + '- * ', end = '')
   print()
 print()
swapping_stars()

# name: find_secret
# purpose:
# input: list, item
# returns:

def find_secret(list_of_lists, item):
  for i in range(0,len(list_of_lists)):
    for j in range(0,len(list_of_lists[i])):
      if list[i][j] == item:
        print(Fore.MAGENTA + 'Found at ' + str(i) + ', ' + str(j))
  

def main():
  print_until(5)
  l1 = [1,3,5,7]
  l2 = [3,1,9,7]
  list_of_lists = [
  ['where', 'is', 'the'],
  ['super', 'duper', 'secret', 'word'],
  ['i', 'can', 'find']
  ]
  secret_item = random.randint(list_of_lists[0][2])       find_secret (lists_of_lists, secret_item)
  compare_lists(l1,l2)
main()