-
Notifications
You must be signed in to change notification settings - Fork 11
Practice: Variables
What is the type of variable s
?
s:bool
s = true
print s
Choose one correct answer:
- A:
true
- B:
bool
- C:
false
- D: program errors
- E: none of the above
Solution
BWhat is the type of variable s
?
s:string
s = true
print s
Choose one correct answer:
- A:
true
- B:
string
- C:
bool
- D: program errors
- E: none of the above
Solution
DWhat is the type of variable s
?
s:string
s = "true"
print s
Choose one correct answer:
- A:
true
- B:
string
- C:
bool
- D: program errors
- E: none of the above
Solution
BWhat is the type of variable s
?
s:num
s = 3
print s
Choose one correct answer:
- A:
number
- B:
3
- C:
string
- D: program errors
- E: none of the above
Solution
EWhat is the type of variable s
?
s = 3
s:num
print s
Choose one correct answer:
- A:
number
- B:
3
- C:
string
- D: program errors
- E: none of the above
Solution
DWhat is the type of variable s
?
s = 3
print s
Choose one correct answer:
- A:
num
- B:
3
- C:
string
- D: program errors
- E: none of the above
Solution
DWhat is the type of variable s
?
s := 3
print s
Choose one correct answer:
- A:
num
- B:
3
- C:
string
- D: program errors
- E: none of the above
Solution
AWhat is the type of variable s
?
s = "3"
print s
Choose one correct answer:
- A:
num
- B:
3
- C:
string
- D: program errors
- E: none of the above
Solution
DWhat is the type of variable s
?
s := "3"
print s
Choose one correct answer:
- A:
num
- B:
3
- C:
string
- D: program errors
- E: none of the above
Solution
CWhat is the type of variable s
?
s = true
print s
Choose one correct answer:
- A:
bool
- B:
3
- C:
string
- D: program errors
- E: none of the above
Solution
DWhat is the type of variable s
?
s := true
print s
Choose one correct answer:
- A:
bool
- B:
true
- C:
string
- D: program errors
- E: none of the above
Solution
AWhat is the type of variable s
?
s:string
s := "abc"
print s
Choose one correct answer:
- A:
bool
- B:
"abc"
- C:
string
- D: program errors
- E: none of the above
Solution
DWhat is the type of variable s
?
s:string
s = "abc"
print s
Choose one correct answer:
- A:
bool
- B:
"abc"
- C:
string
- D: program errors
- E: none of the above
Solution
CWhat is the type of variable s
?
s := "abc"
s = "123"
print s
Choose one correct answer:
- A:
bool
- B:
"abc"
- C:
string
- D: program errors
- E: none of the above
Solution
CWhat is the type of variable s
?
s := "abc"
s := "123"
print s
Choose one correct answer:
- A:
bool
- B:
"abc"
- C:
string
- D: program errors
- E: none of the above
Solution
DWhat is the type of variable s
?
s = "abc"
s := "123"
print s
Choose one correct answer:
- A:
bool
- B:
"abc"
- C:
string
- D: program errors
- E: none of the above
Solution
DWhat does this program output?
s := "false"
print s s
Choose one correct answer:
-
A:
s s
-
B:
false false
-
C:
"s s"
-
D: program errors
-
E: none of the above
Solution
BWhat does this program output?
s := true
print s s
Choose one correct answer:
-
A:
s s
-
B:
true true
-
C:
"s s"
-
D: program errors
-
E: none of the above
Solution
BWhat does this program output?
s:bool
print s s
Choose one correct answer:
-
A:
s s
-
B:
false false
-
C:
"s s"
-
D: program errors
-
E: none of the above
Solution
BWhat does this program output?
s:bool
s = true
print s s
Choose one correct answer:
-
A:
s s
-
B:
true true
-
C:
"s s"
-
D: program errors
-
E: none of the above
Solution
BWhat does this program output?
s := true
s = true
print s s
Choose one correct answer:
-
A:
s s
-
B:
true true
-
C:
"s s"
-
D: program errors
-
E: none of the above
Solution
BWhat does this program output?
s:num
print s s
Choose one correct answer:
-
A:
s s
-
B:
0 0
-
C:
"s s"
-
D: program errors
-
E: none of the above
Solution
BWhat does this program output?
s := 2
print s s
Choose one correct answer:
-
A:
s s
-
B:
2 2
-
C:
"s s"
-
D: program errors
-
E: none of the above
Solution
BWhich drawing does this program create?
c2 := "red"
c1 := "blue"
w1 := 2
w2 := 5
color c1
width w1
move 20 80
line 80 80
color c2
move 20 60
line 80 60
width w2
move 20 40
line 80 40
color c1
move 20 20
line 80 20
Choose one correct answer:
- A:
- B:
- C:
- D:
- E:
Solution
AWhich drawing does this program create?
c2 := "red"
c1 := "blue"
w1 := 2
w2 := 5
color c1
width w1
move 20 80
line 80 80
width w2
move 20 60
line 80 60
color c2
move 20 40
line 80 40
width w1
move 20 20
line 80 20
Choose one correct answer:
- A:
- B:
- C:
- D:
- E:
Solution
BWhich drawing does this program create?
c1 := "red"
c2 := "blue"
w1 := 2
w2 := 5
color c1
width w1
move 20 80
line 80 80
width w2
move 20 60
line 80 60
color c2
move 20 40
line 80 40
width w1
move 20 20
line 80 20
Choose one correct answer:
- A:
- B:
- C:
- D:
- E:
Solution
CWhich drawing does this program create?
c1 := "red"
c2 := "blue"
w1 := 2
w2 := 5
color c1
width w1
move 20 80
line 80 80
width w2
move 20 60
line 80 60
color c2
move 20 20
line 80 20
width w1
move 20 40
line 80 40
Choose one correct answer:
- A:
- B:
- C:
- D:
- E:
Solution
DWhich drawing does this program create?
c1 := "red"
c2 := "blue"
w1 := 2
w2 := 5
color c1
width w1
move 20 60
line 80 60
width w2
move 20 80
line 80 80
color c2
move 20 20
line 80 20
width w1
move 20 40
line 80 40
Choose one correct answer:
- A:
- B:
- C:
- D:
- E:
Solution
EWhich program creates the following output?
true false
Choose three correct answers:
-
A:
x1 := true x2 := false print x1 x2
-
B:
b:bool print "true" b
-
C:
x1:string x1 = "true" x2 := "false" print x1 x2
-
D:
x1:string x1 := "true" x2 := false print x1 x2
Solution
A,B,CWhich program creates the following output?
1 0
Choose three correct answers:
-
A:
x1:num x2 := 1 print x1 x2
-
B:
x2:num x1 := 1 print x1 x2
-
C:
x1 := "1" x2 := 0 print x1 x2
-
D:
x1 := "1" x2:num print x1 x2
Solution
B,C,DWhich program creates the following output?
0 false
Choose three correct answers:
-
A:
x1:num x2 := false print x1 x2
-
B:
x1:num x2:bool print x1 x2
-
C:
x1:num x2 := " false " print x1 x2
-
D:
x1:num x2 := "false" print x1 x2
Solution
A,B,DWhich program creates the following output?
0 true
Choose three correct answers:
-
A:
x1:num x2 := true print x1 x2
-
B:
x1:num x2:bool print x1 x2
-
C:
x1:num x2 := "true" print x1 x2
-
D:
x1 := "0" x2 := "true" print x1 x2
Solution
A,C,DWhich program creates this drawing ?
![squares](https://private-user-images.githubusercontent.com/1596871/248527174-681319a3-61d9-4435-baa8-8376ae6096fb.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNTk4NTEsIm5iZiI6MTczOTI1OTU1MSwicGF0aCI6Ii8xNTk2ODcxLzI0ODUyNzE3NC02ODEzMTlhMy02MWQ5LTQ0MzUtYmFhOC04Mzc2YWU2MDk2ZmIucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxMSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTFUMDczOTExWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NDk5YjZlZTNjYmVjYjIyYjU0MTUyZTc1NjAyZmNhZGUwYjUwYTBmMDNmMzE1NmU2ZTA0ZjU2YTRkNzBiMWM5MSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.zZrEHqISIkfAZ_9gOUal1b4g_YCYU2X-NHNi9cNYAGs)
Choose two correct answers:
-
A:
w := 30 w2 := 10 rect w w rect w w rect w2 w2
-
B:
w := 30 w2 := 10 rect w w rect w2 w2 rect w w
-
C:
w := 10 move 30 30 rect w w w = 30 rect w w move 0 0 rect w w
-
D:
w := 10 w2 = 30 rect w2 w2 rect w w rect w2 w2
Solution
B,CWhich program creates this drawing ?
![squares](https://private-user-images.githubusercontent.com/1596871/248529108-fa79c1fb-6d5d-46f1-aacb-814e7ff9851b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNTk4NTEsIm5iZiI6MTczOTI1OTU1MSwicGF0aCI6Ii8xNTk2ODcxLzI0ODUyOTEwOC1mYTc5YzFmYi02ZDVkLTQ2ZjEtYWFjYi04MTRlN2ZmOTg1MWIucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxMSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTFUMDczOTExWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MjIyYjE2YmU1MzI2Y2JiZDBmMzk3ODVlZTkzMDQwMjAwYTAxODY2MWY3NzJkYzg1ZmM1ODI5OTJlODE0ZWEwMSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.DL7xGLi0VyB2cgtAmNqVN9VSOty-20lhtKzEloqv8bk)
Choose two correct answers:
-
A:
w1 := 20 w2 := 40 rect w1 w1 rect w2 w2 rect w1 w1
-
B:
w := 20 rect w w w = 40 rect w w w = 20 rect w w
-
C:
w1 := 40 w2 := 20 rect w1 w1 rect w2 w2 rect w1 w1
-
D:
w := 20 rect w w w = 40 rect w w w := 20 rect w w
Solution
A,BWhich program creates this drawing ?
![lines](https://private-user-images.githubusercontent.com/1596871/248529353-2506ba1f-ccfc-4f66-8cbb-855ea2224f1f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNTk4NTEsIm5iZiI6MTczOTI1OTU1MSwicGF0aCI6Ii8xNTk2ODcxLzI0ODUyOTM1My0yNTA2YmExZi1jY2ZjLTRmNjYtOGNiYi04NTVlYTIyMjRmMWYucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxMSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTFUMDczOTExWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YTVkNzMzZTdlZjZmZWRiM2JhYWQ1MmZlOTY0NzU5ZGM3NjEzMjE4NmY3MmY1MmY3MDM4NWIzZTIzNDc4ZDMyYiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.D0zR2xRNMW3l_FUTggwWakBJux9I1b6JZibxbQ6i1GA)
Choose two correct answers:
-
A:
c := "red" c2 := "black" width 2 color c2 line 30 60 color c line 60 20 line 90 90
-
B:
c := "red" c2 := "black" width 2 color c2 line 30 60 color c line 60 20 color c2 line 90 90
-
C:
c := "red" c2 := "black" width 2 color c2 line 30 60 move 90 90 line 60 20 color c line 30 60
-
D:
c := "red" c2 := "black" width 2 color c2 line 30 60 move 90 90 line 60 20 color c line 30 50
Solution
B,CWhich program creates this drawing ?
![circles](https://private-user-images.githubusercontent.com/1596871/248529621-46622bd4-3660-413c-8ff0-eeb0d0a90581.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNTk4NTEsIm5iZiI6MTczOTI1OTU1MSwicGF0aCI6Ii8xNTk2ODcxLzI0ODUyOTYyMS00NjYyMmJkNC0zNjYwLTQxM2MtOGZmMC1lZWIwZDBhOTA1ODEucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxMSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTFUMDczOTExWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MDEwMzYzODBlY2MyY2E3OTBiZTI3ZDNiZWIzYjQwN2M5ODQ2ZDkzZTQ1MDUzOTZkNDAwZGJlZTY3NzE3NmI3NyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.SuUeYVHpFoqnLhKU60OKddNzl9Pinq3bcXZdWX-GCvI)
Choose two correct answers:
-
A:
c := "red" c2 := "black" p2 := 70 move 70 50 color c circle 30 move p2 50 color c2 circle 30
-
B:
c := "red" c2 := "black" move 70 50 color c circle 30 move 30 50 color c2 circle 30
-
C:
x := 70 r := 30 move x 50 color "red" circle r move r 50 color "black" circle r
-
D:
x := 70 r := 30 move x 50 color "red" circle r move x 50 color "black" circle r
Solution
B,CAdd the missing line of code to create the output below:
a := "abc"
b:num
// --- missing line of code goes here ---
print a b
Output
abc 2.4
Missing line of code
Solution
b = 2.4
Add the missing line of code to create the output below:
b := 2.4
// --- missing line of code goes here ---
print a b
Output
abc 2.4
Missing line of code
Solution
a := "abc"
Add the missing line of code to create the output below:
a:string
a = "abc"
// --- missing line of code goes here ---
print a b
Output
abc 2.4
Missing line of code
Solution
b := 2.4
Add the missing line of code to create the output below:
a:string
b := 2.4
// --- missing line of code goes here ---
print a b
Output
abc 2.4
Missing line of code
Solution
a = "abc"
Overview | About | Playground | Gallery