Counting posts with 100 or more views
Predict the output · Medium · §7.3 Building up
This code tries to count the posts with 100 or more views. Predict the output without running the code.
Code
views = [120, 45, 300, 80]
for v in views:
count = 0
if v >= 100:
count += 1
print(count)Solve this problem in your browser
Python runs in your browser and checks your answer right away. Hints and the answer are on the problem page.