Predict the output
What do the two lines print?
endpoints = 40
status_codes = 8
regions = 4
series = endpoints * status_codes * regions
print(series)
users = 100_000
print(series * users) # after adding a user_id labelHint 1 of 1
Combinations multiply.
Choose an answer, then open Show answer below to check it.
Show answer
Answer: A 1280 then 128000000
Correct. 40 × 8 × 4 series, then multiplied by 100,000 users.
Every distinct combination of label values is its own time series, so the counts multiply: 40 × 8 × 4 = 1,280. A user_id label multiplies that by every user.
Why not the others?
- B
52then100052. Label values multiply; they don't add. - C
1280then1280. Each user id makes new series. - D
1280then100000. Every existing combination is split per user.