Consider the following program. Write down the output for lines 5-12 (line 10 doesn't print anything). 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. x = 12 y = 5 z = 3.0 print(x + 2) print (x / y) print (x // y) print (x % y) print (y % x) y = y + 5 print(y) print (z + x) For example: Line 5 prints 14 4
Added by Ramon T.
Step 1
Step 1: The value of x is 12. Show more…
Show all steps
Your feedback will help us improve your experience
Willis James and 82 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
(Print a table) Write a program that displays the following table: $\begin{array}{lll}a & b & a \neq b \\ 1 & 2 & 1 \\ 2 & 3 & 8 \\ 3 & 4 & 81 \\ 4 & 5 & 1024 \\ 5 & 6 & 15625\end{array}$
(Print a table) Write a program that displays the following table: $$\begin{array}{lll} \mathrm{a} & \mathrm{b} & \text { pow }(\mathrm{a}, \mathrm{b}) \\ 1 & 2 & 1 \\ 2 & 3 & 8 \\ 3 & 4 & 81 \\ 4 & 5 & 1024 \\ 5 & 6 & 15625 \end{array}$$
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Transcript
18,000,000+
Students on Numerade
Trusted by students at 8,000+ universities
Watch the video solution with this free unlock.
EMAIL
PASSWORD