#Q4 scores_str = input("Enter scores: ") scores = [int(s) for s in scores_str.split()] scores.sort() second_smallest = float('inf') for score in scores: if score < second_smallest: second_smallest = score else: break print("Second smallest score =", second_smallest)
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter