click below
click below
Normal Size Small Size show me how
Comp. Sci. - Python
Q&A
Question | Answer |
---|---|
Why is an interpreter slower than an assembler or a compiler? (less likely to appear) | Because translation is taking place simultaneously, which takes longer |
What are the rules for variable names? | Must be: Alphanumeric Can include underscore, can't start with one can't begin with a numeral can't include the space character can't capitalize the first letter |
What are the arithmetic operators? | + Add - Subtract * Multiply / Divide - Floating Point // Divide - Integer % Mod - the remainder |
What are the 3 fundamental control structures? | Sequence Selection Repetition |
What are the 6 phases of software development? | Requirements Design Implementation (AKA 'coding') Testing Deployment Maintenance |
What are the 3 Important Aspects of computer learning? | Knowledge Understanding Ability |
What does the colon do at the end of a for-statement? (less likely to appear) | It's a signal to the interpreter that subordinate statements will follow. |
What are the 3 Kinds of Errors? | Syntax Errors Execution Errors Logic Errors |
What are the 4 steps of the while-loop Checklist? | 1. Choose a variable to control the loop 2. Initialize that variable before the loop 3. Use that variable in the (Boolean) statement of the while-loop 4. Alter the value of the variable in the loop so that eventually the expression becomes false. |
What can we not change in strings? (less likely to appear) | The characters. We can only replace the strings, and/or 'slice' them. |
What are the 3 steps of the function checklist? | 1. What does it do(OR compute)? 2. What goes in? 3. What comes out? |
What are the 3 kinds of programming languages? | Machine Language Assembly Language High-Level Language |
What are the control structures we used most this semester? (less likely to appear, there are basically 3 of them) | if, if/else, if/elif/else, while, for |
What are the 6 relational operators? (less likely to appear) | < <= > >= == != |
What are the 3 Boolean operators we used most this semester? | and, or, not |
What values can a Boolean Value have? | True or False |
What are 3 tools to help us find what we need to know? (this question is vague, but it's helpful to remember) | Tracing the program by hand Diagnostic Output Debuggers |
What does the screen output if you ran a program with this code? (just an exercise) a = 0*5 print(str(a)*0) | 00000 |
If P is True, and Q is False, what is: 1. P and not Q? 2. not( P and Q)? 3. Q and not P? 4. P or not Q 5. not P or Q 6. not (P or not Q) | 1. True 2. True 3. False 4. True 5. False 6. False |