← Quiz: First API Call: all 10 questions
Quiz: First API Call · Question 7 of 10
What does this print? (code)
What does this print?
price_in, price_out = 2.00, 10.00 # USD per million tokens
input_tokens, output_tokens = 10_000, 1_000
usd = input_tokens / 1e6 * price_in + output_tokens / 1e6 * price_out
print(round(usd, 4))
- A.0.012
- B.0.3
- C.0.03
- D.12.0
Answer & explanation
Correct answer: 0.03
0.02 dollars for input plus 0.01 dollars for output.
Can you get the rest right without peeking?
Take the timed Quiz: First API Call quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →