8000 Updating multiple choice questions · zfoxpython/intro-to-python@dcfca73 · GitHub
[go: up one dir, main page]

Skip to content

Commit dcfca73

Browse files
committed
Updating multiple choice questions
1 parent 24dd941 commit dcfca73

File tree

8 files changed

+204
-136
lines changed

8 files changed

+204
-136
lines changed
Lines changed: 37 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,79 @@
11
# KPMG:Code - Session 1 - Multiple Choice Questions
22

3-
1. What is programming?
3+
1. What is programming?
4+
45
- Giving the computer instructions - A
5-
- Choosing a television show
6+
- Choosing a television show
67
- Knitting a scarf
7-
- Completing some math equations
8+
- Completing some math equations
89

910
2. What is a text editor?
11+
1012
- A place to write an essay
11-
- A place to write code - A
13+
- A place to write code - A
1214
- A place to write a report
13-
- A place to edit a novel
15+
- A place to edit a novel
16+
17+
3. When naming a Python file, what is the file extension used?
1418

15-
3. When naming a Python file, what is the file extension used?
1619
- .doc
1720
- .xlsx
1821
- .py - A
19-
- .csv
22+
- .csv
23+
24+
4. What does print() do?
2025

21-
4. What does print() do?
2226
- prints out a document to a printer
23-
- prints the code output to the screen - A
24-
- 3D prints a Python
25-
- posts to social media
27+
- prints the content to the screen - A
28+
- 3D prints a Python
29+
- posts to social media
30+
31+
5. What are the rules for variables?
2632

27-
5. What are the rules for variables?
2833
- Lowercase
2934
- Underscore instead of spaces
3035
- No punctuation
31-
- All of the above - A
36+
- All of the above - A
3237

3338
6. Which of the below is a string?
39+
3440
- "hello world" - A
3541
- 6
3642
- True
3743
- 7.9
3844

39-
7. Which of the below is a float?
45+
7. Which of the below is a float?
46+
4047
- "hello world"
4148
- 6
4249
- True
43-
- 7.9 - A
50+
- 7.9 - A
51+
52+
8. Which character lets you put in a new line?
4453

45-
8. Which character lets you put in a new line?
4654
- \n - A
4755
- /n
4856
- \t
4957
- \l
5058

51-
9. What will be the output of the below:
59+
9. What will be the output of the below:
60+
5261
first_name = "Steve"
5362
last_name = "Shirley"
5463
full_name = first_name + " " + last_name
55-
print("Good morning, " + full_name)
64+
print("Good morning, " + full_name)
5665

57-
- Good morning Steve
58-
- Good evening Steve
59-
- Good morning Steve Shirley - A
60-
- Good morning Shirley
66+
- Good morning Steve
67+
- Good evening Steve
68+
- Good morning Steve Shirley - A
69+
- Good morning Shirley
70+
71+
10. What will be the output of the below:
6172

62-
10. What will be the output of the below:
6373
correct_sum = 4 + 5 * 2
64-
print(correct_sum)
74+
print(correct_sum)
75+
6576
- 18
6677
- 14 - A
67-
- 13
68-
- 0
78+
- 13
79+
- 0
Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,31 @@
11
# KPMG:Code - Session 2 - Multiple Choice Questions
22

33
1. What is concatenation?
4+
45
- adding cats together
5-
- adding strings together - A
6+
- adding strings together - A
67
- a celebration
78
- a function
89

9-
2. To create a comment in code, what do you put before it?
10+
2. To create a comment in code, what do you put before it?
11+
1012
- !
11-
- # - A
13+
- # - A
1214
- ?
1315
- %
1416

1517
3. What will be the output of the below?
18+
1619
a = int(2.6)
1720
print (a)
1821

1922
- 2.6
2023
- two point six
2124
- True
22-
- 2 - A
25+
- 2 - A
2326

2427
4. How can you fix the below error?
28+
2529
age = 21
2630

2731
# ERROR: TypeError: can only concatenate str (not "int") to str
@@ -33,16 +37,18 @@ print("You are: " + age + " years old")
3337
- cast the age variable to a float
3438

3539
5. What is the output of below?
40+
3641
name = "Ada Lovelace!"
3742
name_length = len(name)
3843
print(name_length)
3944

4045
- 10
4146
- 11
4247
- 12
43-
- 13 - A
48+
- 13 - A
4449

4550
6. What is the output of below?
51+
4652
animal = "Giraffe"
4753
print(animal[0])
4854

@@ -51,28 +57,32 @@ print(animal[0])
5157
- e
5258
- E
5359

54-
7. Which prints out the last element of a string?
55-
- print("python"[-1]) - A
60+
7. Which prints out the last element of a string?
61+
62+
- print("python"[-1]) - A
5663
- print("python"[0])
5764
- print("python"[-4])
5865
- print("python"[1])
5966

60-
8. What function takes an input from a user?
67+
8. What function takes an input from a user?
68+
6169
- enter()
6270
- print()
63-
- input()
71+
- input() - A
6472
- add()
6573

66-
9. What will be the output of the below:
74+
9. What will be the output of the below:
75+
6776
colour = "yellow"
68-
print(colour.upper())
77+
print(colour.upper())
6978

70-
- Yellow
79+
- Yellow
7180
- yellow
72-
- YELLOW - A
73-
- YeLLow
81+
- YELLOW - A
82+
- YeLLow
83+
84+
10. What will be the output of the below:
7485

75-
10. What will be the output of the below:
7686
fullname = "Alan" + "Turing"
7787
length = len(fullname)
7888
middle_letter = fullname[int(length / 2)].lower()
@@ -81,5 +91,5 @@ print("The middle letter of your name is " + middle_letter)
8191

8292
- A
8393
- u - A
84-
- t
85-
- G
94+
- t
95+
- G

session_03/exercises/multiple_choice_3.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
# KPMG:Code - Session 3 - Multiple Choice Questions
22

33
1. What is a conditional?
4+
45
- an expression that allows a user to enter an input
56
- an expression that allows a computer to make a decision - A
67
- an expression that allows a computer to print an output
78
- an expression that makes a string upper case
89

910
2. What will be the output of the below:
11+
1012
sum = 5 + 6
1113

1214
if sum == 10:
@@ -18,6 +20,7 @@ if sum == 10:
1820
- 11
1921

2022
3. What will be the output of the below:
23+
2124
name = "Jackie"
2225

2326
if name == "Anita":
@@ -46,6 +49,7 @@ print("Thanks")
4649
- less than or equal to
4750

4851
6. What is the output of below?
52+
4953
age = 15
5054
if age >= 21:
5155
print("You can vote")
@@ -56,20 +60,22 @@ else:
5660
- You cannot vote - A
5761

5862
7. What is the output of below?
63+
5964
traffic_light = "red"
6065

6166
if traffic_light == "green":
6267
print("You can go!")
6368
elif traffic_light == "amber":
64-
print("Get ready to stop..")
69+
print("Get ready to stop...")
6570
else:
6671
print("STOP!")
6772

6873
- Get ready to stop..
69-
- STOP!
70-
- You can go! - A
74+
- STOP! - A
75+
- You can go!
7176

7277
8. What will be the output of the below:
78+
7379
age = 0
7480

7581
if age <= 13:
@@ -87,14 +93,16 @@ else:
8793
- You are 19 or over
8894

8995
9. What will be the output of the below:
96+
9097
age = 14
9198
if age > 12 and age < 20:
9299
print("You are a teenager")
93100

94-
- You are a teenager
101+
- You are a teenager - A
95102
- You are not a teenager
96103

97104
10. What will be the output of the below:
105+
98106
age = 12
99107
if age < 13 or age > 19:
100108
print("You are not a teenager")

0 commit comments

Comments
 (0)
0