Esempio n. 1
0
import code

a_list =[1,2,3]

another_list =["harry", "ron", "hermione"]
yanother_list = [1,"harry", 3.4,"blue"]

the_sum = code.my_sum(a_list)
# print(the_sum)

the_prod = code.my_prod(a_list)
# print(the_prod)

the_count = code.my_count(a_list)
# print(the_count)

print(code.get_filenames('C:\\Users\\JuliaMB\\Desktop\\hermine\\pythoncode'))

#
Esempio n. 2
0
for m in g:
    totalm = m * totalm

print(totalm)

#exercise 4: call the function in code.py, call it in a new way and
import code 
the_sum = code.my_sum(a)
print(the_sum)

# exercise 5: call the function in code.py for products
the_product = code.my_product(a)
print(the_product)

#exercise 6: I have to know how many elements you have in a list
the_count = code.my_count(a)
print(the_count)

#exercise 7: write a function that counts the number of items smaller than 5
the_count_less_than_5 = code.my_count_less_than_5(a)
print(the_count_less_than_5)

#exercise 8: write a function that counts the number of ones in a list
the_count_ones = code.my_count_ones(a)
print(the_count_ones)

#exercise 9: write a function that gives you the max number in a list
the_max = code.my_max(a)
print(the_max)

#exercise 10: write a function that  gives the directory & names of the files in a directory