Chapter 3: Intro To Python Flashcards
1
Q
What does IDE stand for?
A
Integrated Development Environment
2
Q
What is the function of IDE?
A
- Allows common activities of writing software such as:
- editing source code
- building executables
- debugging - Help identify programming errors
3
Q
What are examples of IDE for python?
A
- IDLE Python
- Eclipse
- PyDev
4
Q
Common errors in programming:
A
- Syntax Error
- Runtime Error
- Logic Error
5
Q
Syntax Error
A
- indentation
- spelling errors
6
Q
Runtime error
A
- doesnt appear until program is run
- error message pops up
- called EXCEPTIONS
7
Q
example of runtime error
A
- division by zero
- using identifier that hasnt been defined
8
Q
Logic error
A
- expected output != actual output
- code will run successfully(doesn’t generate error messages)
- to identify: tracing step by step, understand what the code does
9
Q
How to write comments
A
- using #…
- using “””…”””
10
Q
How to check the reserved python words?
A
import keyword
keyword.kwlist
11
Q
Rules for naming variables:
A
- start with LETTER or UNDERSCORE
- CANNOT START W NUMBERS
- cannot use keywords
- only contain alpha-numeric & underscores
- case-sensitive(age!=Age!=AGE)
12
Q
How to differentiate constant from variable?
A
use UPPERCASE to represent a constant
13
Q
What are the Built-in data types by default?
A
- Text type
- Numeric Types
- Boolean Types
- Sequence(list tuple range)
- Binary
14
Q
How can a programmer get the data type of an object?
A
using type() function:
x = 5
print(type(x))
output: <class ‘int’>
15
Q
How are the boolean keywords written as?
A
lower case:
- and/or/not