Added week 7
This commit is contained in:
21
week7/Exercises/ex2.py
Normal file
21
week7/Exercises/ex2.py
Normal file
@@ -0,0 +1,21 @@
|
||||
def main():
|
||||
print('==Exercise 2==')
|
||||
|
||||
lst=[10, 99, 98, 85, 45, 59, 65, 66, 76, 12, 35, 13, 100, 80, 95]
|
||||
print(f"List:{lst}")
|
||||
|
||||
itr,lenlst = 0,len(lst)
|
||||
|
||||
while itr<lenlst:
|
||||
if lst[itr]==100: print(f"There is a 100 at index no: {itr}")
|
||||
itr+=1
|
||||
|
||||
print('==End Of Ex2==')
|
||||
return 0
|
||||
|
||||
def iterhelper(lst,lambda_exec):
|
||||
itr,lenlst = 0,len(lst)
|
||||
while itr<lenlst:lambda_exec(lst[itr]);itr+=1
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
Reference in New Issue
Block a user