Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 37 additions & 26 deletions session_01/exercises/multiple_choice_1.md
Original file line number Diff line number Diff line change
@@ -1,68 +1,79 @@
# KPMG:Code - Session 1 - Multiple Choice Questions

1. What is programming?
1. What is programming?

- Giving the computer instructions - A
- Choosing a television show
- Choosing a television show
- Knitting a scarf
- Completing some math equations
- Completing some math equations

2. What is a text editor?

- A place to write an essay
- A place to write code - A
- A place to write code - A
- A place to write a report
- A place to edit a novel
- A place to edit a novel

3. When naming a Python file, what is the file extension used?

3. When naming a Python file, what is the file extension used?
- .doc
- .xlsx
- .py - A
- .csv
- .csv

4. What does print() do?

4. What does print() do?
- prints out a document to a printer
- prints the code output to the screen - A
- 3D prints a Python
- posts to social media
- prints the content to the screen - A
- 3D prints a Python
- posts to social media

5. What are the rules for variables?

5. What are the rules for variables?
- Lowercase
- Underscore instead of spaces
- No punctuation
- All of the above - A
- All of the above - A

6. Which of the below is a string?

- "hello world" - A
- 6
- True
- 7.9

7. Which of the below is a float?
7. Which of the below is a float?

- "hello world"
- 6
- True
- 7.9 - A
- 7.9 - A

8. Which character lets you put in a new line?

8. Which character lets you put in a new line?
- \n - A
- /n
- \t
- \l

9. What will be the output of the below:
9. What will be the output of the below:

first_name = "Steve"
last_name = "Shirley"
full_name = first_name + " " + last_name
print("Good morning, " + full_name)
print("Good morning, " + full_name)

- Good morning Steve
- Good evening Steve
- Good morning Steve Shirley - A
- Good morning Shirley
- Good morning Steve
- Good evening Steve
- Good morning Steve Shirley - A
- Good morning Shirley

10. What will be the output of the below:

10. What will be the output of the below:
correct_sum = 4 + 5 * 2
print(correct_sum)
print(correct_sum)

- 18
- 14 - A
- 13
- 0
- 13
- 0
44 changes: 27 additions & 17 deletions session_02/exercises/multiple_choice_2.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,31 @@
# KPMG:Code - Session 2 - Multiple Choice Questions

1. What is concatenation?

- adding cats together
- adding strings together - A
- adding strings together - A
- a celebration
- a function

2. To create a comment in code, what do you put before it?
2. To create a comment in code, what do you put before it?

- !
- # - A
- # - A
- ?
- %

3. What will be the output of the below?

a = int(2.6)
print (a)

- 2.6
- two point six
- True
- 2 - A
- 2 - A

4. How can you fix the below error?

age = 21

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

5. What is the output of below?

name = "Ada Lovelace!"
name_length = len(name)
print(name_length)

- 10
- 11
- 12
- 13 - A
- 13 - A

6. What is the output of below?

animal = "Giraffe"
print(animal[0])

Expand All @@ -51,28 +57,32 @@ print(animal[0])
- e
- E

7. Which prints out the last element of a string?
- print("python"[-1]) - A
7. Which prints out the last element of a string?

- print("python"[-1]) - A
- print("python"[0])
- print("python"[-4])
- print("python"[1])

8. What function takes an input from a user?
8. What function takes an input from a user?

- enter()
- print()
- input()
- input() - A
- add()

9. What will be the output of the below:
9. What will be the output of the below:

colour = "yellow"
print(colour.upper())
print(colour.upper())

- Yellow
- Yellow
- yellow
- YELLOW - A
- YeLLow
- YELLOW - A
- YeLLow

10. What will be the output of the below:

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

- A
- u - A
- t
- G
- t
- G
16 changes: 12 additions & 4 deletions session_03/exercises/multiple_choice_3.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
# KPMG:Code - Session 3 - Multiple Choice Questions

1. What is a conditional?

- an expression that allows a user to enter an input
- an expression that allows a computer to make a decision - A
- an expression that allows a computer to print an output
- an expression that makes a string upper case

2. What will be the output of the below:

sum = 5 + 6

if sum == 10:
Expand All @@ -18,6 +20,7 @@ if sum == 10:
- 11

3. What will be the output of the below:

name = "Jackie"

if name == "Anita":
Expand Down Expand Up @@ -46,6 +49,7 @@ print("Thanks")
- less than or equal to

6. What is the output of below?

age = 15
if age >= 21:
print("You can vote")
Expand All @@ -56,20 +60,22 @@ else:
- You cannot vote - A

7. What is the output of below?

traffic_light = "red"

if traffic_light == "green":
print("You can go!")
elif traffic_light == "amber":
print("Get ready to stop..")
print("Get ready to stop...")
else:
print("STOP!")

- Get ready to stop..
- STOP!
- You can go! - A
- STOP! - A
- You can go!

8. What will be the output of the below:

age = 0

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

9. What will be the output of the below:

age = 14
if age > 12 and age < 20:
print("You are a teenager")

- You are a teenager
- You are a teenager - A
- You are not a teenager

10. What will be the output of the below:

age = 12
if age < 13 or age > 19:
print("You are not a teenager")
Expand Down
Loading