initial questions

This commit is contained in:
2023-08-03 17:04:23 -07:00
parent 828452b66b
commit d2d024a906
5 changed files with 282 additions and 20 deletions

45
exercises.py Normal file
View File

@@ -0,0 +1,45 @@
import re
import pandas as pd
def lc(l1: list):
"""For input list l1 of integers, return list of elements
whose square is less than sum of all elements"""
return None
def nlc(l1: list, l2: list):
"""For input lists l1, l2, return a list of elements common
to both l1 and l2."""
return None
def dc(l1: list):
"""For input list l1 of integers, return a dictionary with
keys from l1, and values are squares of keys"""
return None
if __name__ == "__main__":
l1 = [1, 2, 3, 4]
l2 = [2, 4, 6, 8]
print("Inputs:")
print(f"l1: {l1}")
print(f"l2: {l2}")
print("\n-------------------\n")
print("lc:")
print(lc(l2))
print("\n-------------------\n")
print("nlc:")
print(nlc(l1, l2))
print("\n-------------------\n")
print("dc:")
print(dc(l1))
print("\n-------------------\n")