Programming fundamentals Flashcards
A variable is a name that represents values stored in the computer's \_\_\_\_\_\_. • Memory • CPU • Screen • Hard drive
Memory
The output of the following statement is \_\_\_\_. print(-5//2) • -3 • -2.5 • 3 • 2.5
-3
Python allows programmers to break a statement into multiple lines.
TRUE
FALSE
TRUE
A computers CUP can only understand instructions that are written as a sequence of bits.
TRUE
FALSE
TRUE
The format specifier is a string that contains special characters specifying how the numeric value should be formatted.
TRUE
FALSE
TRUE
The argument \_\_\_\_ is passed to the print function. This specifies that the print function should print a space instead of a newline character at the end of its output. • End=’ ‘ • \, • Backslash • comma
end=’ ‘
The python language uses a compiler, which translates a high-level language program into a complete machine language program.
TRUE
FALSE
FALSE
According to the behaviour of integer division, when an integer is divided by an integer, the result will be a float.
TRUE
FALSE
FALSE
A \_\_\_\_\_\_ is a diagram that graphically depicts the steps that take place in a program. • Flowchart • Pseudocode • Algorithm • Program
Flowchart
Comments in Python begin with # character.
TRUE
FALSE
TRUE
The instruction set for a microprocessor is unique and is typically understood only by the microprocessors of the same brand.
TRUE
FALSE
TRUE
Python formats all floating-point numbers to two decimal places when outputting with the print statement.
TRUE
FALSE
FALSE
In Python, print statements written on separate lines do not necessarily output on seperate lines.
TRUE
FALSE
TRUE
Choose all that apply. To create a Python program you can use:
Excel
IDLE
A text editor
A word processor if you save your file as a .docx
IDLE
A text editor
What is the informal language, used by programmers to create models of programs, that has no syntax rules and is not meant to be compiled or executed? • Flowchart • Pseudocode • Algorithm • Source code
Pseudocode
The \_\_\_\_ function reads a piece of data that has been entered at the keyboard and returns that piece of data, as a string, back to the program. • input() • output() • eval_input() • str_input()
input()
Which mathematical operator is used to raise 5 to the second power in Python? • / • ~ • ^ • **
**
In a print statement, you can set the \_\_\_\_\_ argument to a space or empty string to stop the output from advancing to a new line. • end • separator • newLine • stop
end
After the execution of the following statement, the variable price will reference the value \_\_\_\_\_. price = int(68.549) • 68 • 68.6 • 69 • 68.55
68
Which of the following will display 20% • print(format(0.2, ‘.0%’)) • print(format(0.2 * 100, '.0%')) • print(format(20, '.0%')) • print(format(0.2, '%'))
print(format(0.2, ‘.0%’))
The output of the following print statement is \_\_\_\_ print('I\'m ready to begin') • I’m ready to begin • Im ready to begin • I\’m ready to begin • ‘\’m ready to begin.
I’m ready to begin
As per Python variable naming rules, the uppercase and lowercase characters are not distinct.
TRUE
FALSE
FALSE