Quiz: Hangs
Test yourself on the knowledge you learned about hangs.
#!/usr/bin/pythonimport sysimport itertoolsdef square_sum(int_arr):out = i = 0n = len(int_arr)while i < n:try:out += int_arr[i]i = i + 1except:print("erroroneous data seen, ignoring")return outdef main():arr = [1,2,3,4,'5']print(square_sum(arr))if __name__ == "__main__":main()
Get hands-on with 1400+ tech skills courses.