Quiz: Hangs

Test yourself on the knowledge you learned about hangs.

Press + to interact
#!/usr/bin/python
import sys
import itertools
def square_sum(int_arr):
out = i = 0
n = len(int_arr)
while i < n:
try:
out += int_arr[i]
i = i + 1
except:
print("erroroneous data seen, ignoring")
return out
def main():
arr = [1,2,3,4,'5']
print(square_sum(arr))
if __name__ == "__main__":
main()

Get hands-on with 1200+ tech skills courses.