Use LEFT and RIGHT arrow keys to navigate between flashcards;
Use UP and DOWN arrow keys to flip the card;
H to show hint;
A reads text to speech;
26 Cards in this Set
- Front
- Back
- 3rd side (hint)
What is the program development cycle? |
1. Design the program 2. Write the code 3. Correct syntax errors 4. Test the program 5. Correct logic errors |
The process of creating a program that works correctly typically requires five phases. |
|
What is a logic error? |
A mistake that does not prevent the program from running, but causes it to produce incorrect results. |
|
|
Programmers commonly use two tools to help them break down the task that a program must perform, what are they? |
1. Pseudocode 2. Flowcharts. |
|
|
What is pseudocode? |
An informal language that has no syntax rules and is not meant to be compiled or executed. Instead, programmers use pseudocode to create models, or "mock-ups," of programs. |
|
|
What is a flowchart and what symbols are used? |
A flowchart is a diagram that graphically depicts the steps that take place in a program.
Three types of symbols in a flowchart: ovals, parallelograms, and rectangles.
Ovals: are terminal symbols. Parallelograms are either output or input symbols. Rectangles are processing symbols. |
|
|
Why is pseudocode necessary, why not just compile code? |
Pseudocode is the fast way to create a model of the program without worrying about the time consuming task of fixing syntax errors. |
|
|
What is an algorithm? |
A set of well defined logical steps that must be taken to perform a task. |
|
|
Write a statement that displays your name |
2.3 Displaying Output with the print Function
print ('Tanya Ford') |
|
|
Write a statement that displays the following text: Python's the best! |
print("Python's the best!") |
|
|
Write a statement that displays the following text: The cat said "meow." |
print('The cat said "meow."') |
|
|
Comments are notes which document lines of a program. What does the Python interpreter do with comments? How do you begin a comment in Python? |
The Python interpreter ignores comments. In Python you begin a comment with # |
|
|
2.5 Variables What is a variable? |
A name that references a value in the computer's memory. |
|
|
2.5 Variables An assignment statement is written in the following general format: |
variable = expression |
|
|
2.5 Variables What are the variable naming rules? |
* no keywords * no spaces * first character must be a letter (upper or lowercase), or an underscore. * second onwards must be letter, number or underscore. * uppercase and lowercase are distinct. |
|
|
2.5 Variables How do you make variable names easier to read? |
Underscore or camelCase |
|
|
2.5 Variables If variable is set as follows: width = 10 What does this equal: print('width') |
width |
|
|
2.5 Variables Is this a legal variable name? Mixture#3 |
Illegal. Variable names may only use letters, digits or underscores. |
|
|
2.5 Variables Is this a legal variable name? June1997 |
Legal. |
|
|
2.5 Variables
How do you display multiple items with one call to the print function? Use 'I am staying in room number' example. |
room = 100 Print('I am staying in room number', room) |
|
|
2.5 Variables
Which of the following are illegal variable names in Python and why? x 99bottles july2009 theSalesFigure
|
X |
|
|
2.5 Variables A number written into a program's code is called a ? |
Numeric literal |
|
|
2.5 Variables A numeric literal written as a whole number is called a what? A numeric literal written with a decimal point is called a what? |
1. Integer 2. Float |
|
|
2.5 Variables How can you determine the data type of a value? |
Use the type function. Eg: >>>Type(1) <Class 'int'> |
|
|
2.5 You cannot write what In numeric literals? |
Currency symbols, spaces or commas. |
|
|
Dividing any two integers produces what number type? |
Float |
|
|
What is 2**5 |
32 |
|