INNER CODE UNIT · Python

count

ShawhinT/YouTube-Blog · python-quickstart/my-script.py:44

        count = count + 1

print(count, "user(s) interested in Bread")

# count the number of users interested in an arbritrary topic
count = 0
topic = "Antiquing"

for user in user_list:
    if topic in user["Interests"]:
        count = count + 1

print(f"{count} user(s) interested in {topic}")


# basic functions
# ---------------
# print(), a function we've used several times already

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…