conditionals and loops Flashcards
1
Q
T v; F –>
A
if statement
2
Q
break statement to stop the conditional when loops reaches i equal to 4
A
if i==4
break
3
Q
1) T v; 1) F–> 2)
A
if…. else..
4
Q
test if a value (variable “age”) is in a range
A
if (age > 18 && age <25) then…
5
Q
test if a value (variable “age”) is one of two statemens
A
if (age < 18 | | ahe > 25) then…
6
Q
1) T v; 1) F–> 2) T v; F–> 3)
A
if..elif..else
7
Q
T (keeo going); F–> X
A
while..
8
Q
T (keeo going); F–> X BU in a range
A
for each… :
9
Q
range for the loop (increment 1)
A
for i in range (x , y)
print i
10
Q
range for the loop with specific increment z
A
for i in range (x , y, z)
print i