100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.6 TrustPilot
logo-home
Exam (elaborations)

AP Comp Sci Principles Loops Redemption Questions & Answers

Rating
-
Sold
-
Pages
5
Grade
A+
Uploaded on
21-10-2024
Written in
2024/2025

0 1 2 3 4 - ANSWERSWhat is the output? for i in range (5): ..print(i, end = " ") time time time - ANSWERSWhat is the output? for x in range (3): ..print("time", end = " ") 12 - ANSWERSWhat is the output? j = 0 while j 10: ..j+=3 print(j) s e p t e - ANSWERSWhat is the output? word = "september" for let in word: ..if let != "m": ....print(let,) ..else: ....break --- --- --- - ANSWERSWhat is the output? x=3 while x 0: ..y = 3 ..while y0: ....print("-", end = " ") ....y-=1 ..x-=1 print() condition - ANSWERSWhat is the term for x called? while(x) while - ANSWERSA _______ loop is a block of code associated with a condition. As long as the condition is true, the loop will continue to run the block of code. 0 1 2 3 4 - ANSWERSWhat is the output? x = 0 while(x5): ..print(x) ..x+=1 20 16 12 8 4 - ANSWERSWhat is the output? x = 20 while(x0): ..print(x) ..x=x-4 While - ANSWERS_______ loops repeat code as long as a condition is true 4 915 5 91 - ANSWERSWhat is the output? num=9154 print(num%10) print(num/10); num/=10 print(num%10) print(num/10) 4 5 1 9 - ANSWERSWhat is the output? number=9154 while(number0): ..print(number%10) ..number=number/10 For - ANSWERS_______ loops run a set number of times Hi Hi Hi - ANSWERSWhat is the output? for x in range(3): ..print("Hi") 0 1 2 3 4 - ANSWERSWhat is the output? for z in range(5): ..print z 12 13 14 15 - ANSWERSWhat is the output? for r in range (12,16): ..print(r) H e l l o - ANSWERSFor c in "Hello": ..print(c, end =" ") For each - ANSWERS_______ loops run through every character in a string Break - ANSWERSThe keyword _______ allows you to stop a loop early C o m p - ANSWERSWhat is the output? word = "Computer Science" for w in word: ..if w == "u": ....break ..print(w) Nested - ANSWERSIn ______ loops, loops can go inside other loops x is 0 y is 0 y is 1 x is 1

Show more Read less
Institution
AP Comp Sci Principles Loops Redemption
Course
AP Comp Sci Principles Loops Redemption

Content preview

AP Comp Sci Principles Loops
Redemption Questions & Answers
0 1 2 3 4 - ANSWERSWhat is the output?
for i in range (5):
..print(i, end = " ")

time time time - ANSWERSWhat is the output?
for x in range (3):
..print("time", end = " ")

12 - ANSWERSWhat is the output?
j=0
while j < 10:
..j+=3
print(j)

s
e
p
t
e - ANSWERSWhat is the output?
word = "september"
for let in word:
..if let != "m":
....print(let,)
..else:
....break

---
---
--- - ANSWERSWhat is the output?
x=3
while x > 0:
..y = 3
..while y>0:
....print("-", end = " ")
....y-=1
..x-=1
print()

condition - ANSWERSWhat is the term for x called?
while(x)

, while - ANSWERSA _______ loop is a block of code associated with a condition. As
long as the condition is true, the loop will continue to run the block of code.

0
1
2
3
4 - ANSWERSWhat is the output?
x=0
while(x<5):
..print(x)
..x+=1

20
16
12
8
4 - ANSWERSWhat is the output?
x = 20
while(x>0):
..print(x)
..x=x-4

While - ANSWERS_______ loops repeat code as long as a condition is true

4
915
5
91 - ANSWERSWhat is the output?
num=9154
print(num%10)
print(num/10);
num/=10
print(num%10)
print(num/10)

4
5
1
9 - ANSWERSWhat is the output?
number=9154
while(number>0):
..print(number%10)
..number=number/10

Written for

Institution
AP Comp Sci Principles Loops Redemption
Course
AP Comp Sci Principles Loops Redemption

Document information

Uploaded on
October 21, 2024
Number of pages
5
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
Bestgrades2 West Virginia University
View profile
Follow You need to be logged in order to follow users or courses
Sold
29
Member since
1 year
Number of followers
0
Documents
4476
Last sold
1 day ago

4.0

3 reviews

5
1
4
1
3
1
2
0
1
0

Trending documents

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions