Added week 7
This commit is contained in:
20
week7/Exercises/ex3.py
Normal file
20
week7/Exercises/ex3.py
Normal file
@@ -0,0 +1,20 @@
|
||||
def main():
|
||||
print('==Exercise 3==')
|
||||
|
||||
lst1=["Joe", "Sarah", "Mike", "Jess", "", "Matt", "", "Greg"]
|
||||
print(f"List:{lst1}")
|
||||
|
||||
lst2=[]
|
||||
itr,lenlst = 0,len(lst1)
|
||||
|
||||
while itr<lenlst:
|
||||
if lst1[itr]: lst2.append(lst1[itr])
|
||||
itr+=1
|
||||
|
||||
print(f"New List:{lst2}")
|
||||
|
||||
print('==End Of Ex3==')
|
||||
return 0
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
Reference in New Issue
Block a user