Match the flowchart symbol with its meaning.
| Stavka koja se može prevući | arrow_right_alt | Odgovarajuća stavka |
|---|---|---|
| arrow_right_alt | Terminal (Start/End) | |
| arrow_right_alt | Process | |
| arrow_right_alt | Decision | |
| arrow_right_alt | Input/Output | |
| arrow_right_alt | Flow line | |
| arrow_right_alt | Subroutine |
Scenario:
A simple program asks the user to choose heads or tails and enter their choice. The program then randomly generates either heads or tails. Next, the user’s choice is compared to the random result. If the two match, the program displays “You won”. If they do not match, the program displays “You lost.”
Select the correct flowchart from the options shown below that represents this program.
What is the decimal value of binary 10110?
If translators (compilers and interpreters) did not exist, what would be the primary consequence for modern software development?
Identify the syntax error in this code:
from time import sleep
print("Program starting...")
sleep(2)
print("Done!)In Python, what can a string contain?
Which of the following print statements is properly formatted with a string? Select all that apply.
Which of the following indicates that your file has been saved as a Python file?
Which of the following is a comment?
What is the output of this code:
name="Garry"
name="Sam"
print(name)
In the context of variables, what does 'assignment' mean?
Which naming convention rule is violated in this variable name: 'my score'?
When you use the input() function in Python, what data type is always returned regardless of what the user enters?
Why does adding two input values together result in concatenation instead of mathematical addition?
What will happen when this code executes if a user enters 5 and 3?
num1 = input()
num2 = input()
result = num1 + num2
print(result)
What is the correct way to convert user input to an integer?
What will be the order of operations in the following code?
num = 10 * 3 % 2 - 5
What is the value of num in the following code?
num = 18 % 7
What will be the data type of num?
num = 5 // 2
What will be the output(s) from the following code? (Select all that apply)
friends = 8
family = 4
total_people = friends + family
if total_people >= 10:
print("too many people for the party")
if total_people < 5:
print("not enough people for the party")
if friends > 3:
print("You have a lot of friends!")
if family > 5:
print("You have a big family!")
The following code has an error. How can you fix it?
age = input("What is your age?")
decades_old = age / 10
Which line of code will cause a variable-naming error?
1) total-score = 50
2) total_score = 50
3) _value1 = 10
4) student2 = "Ava"What does the following code print?
x = 3
y = 9
print(y % x == 0)Assume the user enters: 19
age = input("Age: ")
if int(age) >= 18:
print("Adult")
if int(age) < 18:
print("Minor")What is printed?