Programming Rock, Paper, Scissors Part 2 OALH
star
star
star
star
star
Last updated over 3 years ago
22 questions
1
What is a variable?
What is a variable?
1
What is the convention for naming variables?
What is the convention for naming variables?
1
What is an f-string used for?
What is an f-string used for?
1
Look at the following code If the input was 14 what would the output be?
Look at the following code
If the input was 14 what would the output be?
1
What would happen if the string “crab” was entered instead of a number?
What would happen if the string “crab” was entered instead of a number?
1
| Draggable item | arrow_right_alt | Corresponding Item |
|---|---|---|
Real/float | arrow_right_alt | False |
Boolean | arrow_right_alt | "Hello" |
Char | arrow_right_alt | "a" |
String | arrow_right_alt | 5.2 |
Integer | arrow_right_alt | 283 |
1
Predict: try to make a prediction about what might happen when this code is executed.
Predict: try to make a prediction about what might happen when this code is executed.
1
What data type is being collected at line 2?
What data type is being collected at line 2?
1
Run the program and type more than 1 character when asked for your first initial.What happens?
Run the program and type more than 1 character when asked for your first initial.
What happens?
1
Why do you think this is?
Why do you think this is?
1
Does Python have a function for char?
Does Python have a function for char?
1
Run the program and type in some string (text) when you are asked for your age. What happens?
Run the program and type in some string (text) when you are asked for your age. What happens?
1
Why do you think this happens?
Why do you think this happens?
1
Run the program and type in all lower case true when asked if you like marmite. What happens to the marmite message?
Run the program and type in all lower case true when asked if you like marmite. What happens to the marmite message?
1
Run the program and type in True when asked if you like marmite. What happens to the marmite message?
Run the program and type in True when asked if you like marmite. What happens to the marmite message?
1
Run the program and type in hello when asked if you like marmite. What happens to the marmite message?
Run the program and type in hello when asked if you like marmite. What happens to the marmite message?
1
Line 12 contains the following piece of code likes_marmite == marmite". What do you think might be happening here?
Line 12 contains the following piece of code likes_marmite == marmite". What do you think might be happening here?
1
Run the program and type 9 when you are asked for your age. What happens?
Run the program and type 9 when you are asked for your age. What happens?
1
On line 10, the forward slash / is being used between the variable age and the number 10. What arithmetic operation is the forward slash performing?
On line 10, the forward slash / is being used between the variable age and the number 10. What arithmetic operation is the forward slash performing?
1
On line 10, change the word float to int. Run the code and type in 9 as your age. What happens?
On line 10, change the word float to int. Run the code and type in 9 as your age. What happens?
1
Keeping line 10 as int. Run the code and type in 28 as your age. What happens?
Keeping line 10 as int. Run the code and type in 28 as your age. What happens?
1
What do you think is happening when the number is held as an integer compared to a float?
What do you think is happening when the number is held as an integer compared to a float?