Twa kɔ nsɛm atitiriw so
Log in
Sign up for FREE
arrow_back
Laabri

Programming rock paper scissors part 1 TPE

star
star
star
star
star
Last updated over 4 years ago
26 Nsɛmmisa

Do Now

1
1
1
1
1

Variable Questions

1
1
1
1

Silly Sentences

1
1
1
1
1
1
1
1
1
1
1

Selection Questions

1
1
1
1
1
1
Asemmisa {{asɛmmisaAhyɛnsode}}
1.

Name an ethical hacker

Asemmisa {{asɛmmisaAhyɛnsode}}
2.

Convert 10 into binary

Asemmisa {{asɛmmisaAhyɛnsode}}
3.

Convert 101 into binary

Asemmisa {{asɛmmisaAhyɛnsode}}
4.

What will the following code display?

user = xXedgelord420Xx

print ("Hello", user)

Asemmisa {{asɛmmisaAhyɛnsode}}
5.

What will the following code display?

user = xXegrill69Xx

print ("Hello, user")

Asemmisa {{asɛmmisaAhyɛnsode}}
6.

What is a variable?

Asemmisa {{asɛmmisaAhyɛnsode}}
7.

What is the convention for naming variables?

Asemmisa {{asɛmmisaAhyɛnsode}}
8.

How do you declare if a variable is a string or an integer?

Asemmisa {{asɛmmisaAhyɛnsode}}
9.

What is initialisation of a variable?

Asemmisa {{asɛmmisaAhyɛnsode}}
10.

Take a look at the code below. Predict what might happen?

Asemmisa {{asɛmmisaAhyɛnsode}}
11.

Using Trinket below, recreate and run the code. Did anything unexpected happen? Write down your thoughts.

Asemmisa {{asɛmmisaAhyɛnsode}}
12.

In which line is the variable adjective initialised?

Asemmisa {{asɛmmisaAhyɛnsode}}
13.

In which line is the variable adverb first reassigned?

Asemmisa {{asɛmmisaAhyɛnsode}}
14.

When is the variable noun first used?

Asemmisa {{asɛmmisaAhyɛnsode}}
15.

Is there a difference between the code in line 4 and line 8?

Asemmisa {{asɛmmisaAhyɛnsode}}
16.

On line 4, remove the f after print and before the speech mark. Run the code and write down what happens.

! Remember to place the f back in when you have finished.

Asemmisa {{asɛmmisaAhyɛnsode}}
17.

What do you think the f is used for? (google python-f-strings for help)

Asemmisa {{asɛmmisaAhyɛnsode}}
18.

On line 4, remove the curly {} brackets that surround noun and run the code again. What happens?

! Remember to place the {} back in when you have finished.

Asemmisa {{asɛmmisaAhyɛnsode}}
19.

Why does it not display "The Car Zebra was loud giant when it gently aggressively went to school when the code is executed?"

Modify your code with the following questions:

1. Change all values in both occurrences of noun, adjective, and adverb to something different.

2.Create a new variable called proper_noun and initialise it as London.

3. Replace the word school with {proper_noun} in both print statements.

4. Make a change to your code that will ensure that the second print statement displays a different proper noun.

5.Add a completely new silly sentence to the bottom of the code. You can use the same variables but think of a different sentence to write.

Asemmisa {{asɛmmisaAhyɛnsode}}
20.

Add your edited code

Asemmisa {{asɛmmisaAhyɛnsode}}
21.

For each of these example programs, decide what will be displayed (output) based on the values that are inputted.

Input is Harry, Output is

Input is Shariff, Output is

Input is Evelyn, Output is

Asemmisa {{asɛmmisaAhyɛnsode}}
22.

Input is 25, Output is

Input is 27, Output is

Input is 12, Output is

Asemmisa {{asɛmmisaAhyɛnsode}}
23.

Input June Output

Input July Output

Input August Output

Asemmisa {{asɛmmisaAhyɛnsode}}
24.

Input 6 Output

Input 10 Output

Input 7 Output

Asemmisa {{asɛmmisaAhyɛnsode}}
25.

Input 7 Ouput

Input 9 Output

Input 3 Output

Asemmisa {{asɛmmisaAhyɛnsode}}
26.

Input 67 Output

Input 24 Output

Input 93 Output