0% found this document useful (0 votes)
83 views4 pages

Study Guide

The document discusses various Python programming concepts including data types, operators, functions, modules, errors and debugging. It provides definitions and examples of key terms like strings, lists, tuples, dictionaries, numeric types, functions, arguments, modules and errors. Various string, list and dictionary methods are also outlined along with formatting numeric output and performing conversions between types.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
83 views4 pages

Study Guide

The document discusses various Python programming concepts including data types, operators, functions, modules, errors and debugging. It provides definitions and examples of key terms like strings, lists, tuples, dictionaries, numeric types, functions, arguments, modules and errors. Various string, list and dictionary methods are also outlined along with formatting numeric output and performing conversions between types.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

 Basic instruction types are input, process, and: OUTPUT

 Which symbol is used in Python to create a comment? #


 In the statement: the string 'Enter your age: ' is called a(n) PROMPT
age = input ('Enter your age:’)
 Which type of error does not cause the program to crash? LOGIC ERROR.
 What is an IDE used for? Program development.
 0s and 1s are known as: BITS.
 Ram is: Random access Memory.
 Because Python 2.7 programs cannot be run by the Python 3.0 interpreter, Python 3.0 is not:
Backwards compatible.
 Dividing by zero is an example of which type of error? RUNTIME.
 Which statement outputs the text: "I won't quit!"? print ("I won't quit!")
 What is the value of y after the following code is executed? Note that the question asks for y, not x.
12
 Which of the following symbols can be used as part of an identifier? _ (underscore)
 The built-in Python function that gives an object's identity is: id ()
 Which of the following data values is best represented with a floating-point variable? The speed of
a snail.
 Which expression using parentheses is equivalent to the following expression: x - y * -z / 3. x - ((y *
(-z)) / 3)
 The operator *= is called a(n) _____ operator. Compound
 15 _____ 3 = 0 %
 What is the value of the __name__ built-in variable in a module that is executed as a script by the
programmer? __main__
 An item passed to a function is a(n) . Argument
 What does print("one\\two\\\\three") display? one\two\\three
 Which statement correctly creates a new tuple west_cities with elements 'Vancouver', 'Portland',
'Eugene' in that order? west_cities=('Vancouver','Portland','Eugene')
 Which statement is true regarding the pop() method for sets? pop() removes a random item in the
set.
 Which statement changes the value associated with key "Lemon" to 0.75 in the dictionary
fruits_dict? fruits_dict["Lemon"]=0.75
 Which pair shows the correct classification of the given data type? string, immutable sequence
type
 Which of the following expressions causes an implicit conversion between types? Assume variable
x is an integer, t is a float, and name is a string. 7.5+(x/2)
 What is the base 10 representation of the binary number: 00001001? 9
 Which formatting presentation type is used to display the integer 43 as 0X2b (hexadecimal in
uppercase)? X
 Which of the following assignment statements creates a list with 4 integer elements?
my_list=[7,2,-8,16]
 What is displayed when the following code is executed?
Empty_string = ‘’print (len(empty_string)). 0
What are the contents of names_list after the following code is executed? ['one', 'two',
'three', '1', '2', '3']
Names_list = [‘one’, ‘two’, ‘three’] Digits_list = [‘1’, ‘2’, ‘3’] Names_list = names_list +
digits_list
1. Program↔Consist of instructions executing one at the time.
a. Input↔Receives data from a file
b. Process↔Performs computations on that data, adding two values like x + y.
c. Output↔Puts that data somewhere, such as file, screen, etc.
2. Algorithm↔Sequence of instructions that solves a problem.
3. Python Interpreter↔Computer program that executes code in that specific language.
4. Interactive interpreter↔Allows the user to execute one line of code at a time.
5. Code↔Common word for the textual representation of a program
6. Prompt↔Indicates that the interpreter is ready to accept the code.
7. Statement↔Program instruction.
8. Expressions↔Code that return a value when evaluated.
9. Print()↔Function to display variables or expression values.
10. Comments↔Are optionals but can help to understand the portions of code to a human reader.
11. Newline↔Is used for a line break.
12. "" Nunca con variables, solo con texto.
13. Syntax error↔Violates programming language's rules on how symbols can be combined to created
a program.
14. New programmers should compile their program every three to five lines.
15. Runtime error↔Program's syntax is correct but the program attempts an impossible operation.
16. Crash↔Abrupt and unintended termination of a program.
17. Logic error↔The program would load correctly but would not behave as intended. is often called
BUG.
18. Processors↔Execute a list of desired calculations, each called an instruction.
19. Memory↔Circuit that can store 0s in each of a series of thousands of addressed locations.
20. Script↔Program whose instructions are executed by another program called an interpreter.
21. Python in 1980s.
22. Garbage collection↔Deletes unused objects as an automatic process.
23. Name binding↔Process of associating names with interpreter objects.
24. Python properties
a. Value: 20,50,etc.
b. Type: Type of object, such as integer or string.
c. Identity: Unique identifier that describes the object.
d. Mutability↔Indicates whether the object's value is allowed to be changed.
e. Immutable↔Integer and string values cannot be changed.
f. Floating-point number↔Is a real number
g. Floating-point literal↔Written with the fractional part even if that fraction is 0
25. Overflow↔Occurs when a value is too large to be stored in the memory allocated by the
interpreter.
26. Expression↔Combination of items, like variables, literals, operators, and parentheses, that
evaluates to a value.
27. Literal↔Specific value in code like 2.
28. Operator↔Symbol that performs a built-in calculation like +.
29. Module↔File containing Python code that can be used by other modules or scripts.
30. Function↔List of statements that can be executed simply by referring to the function's name.
31. Function call↔Process of invoking a function.
32. Argument↔Item passed to a function.
33. Random↔random() returns a random floating-point value each time the function is called.
34. randrange()↔Generates random integers within a specified range.
1. String↔Is a sequence of characters, like the text MARY, that can be stored as a variable.
2. String literal↔String value specified in the source code of a program.
o It has a single or double quotes.
o Can contain spaces, periods, and other non-letter characters.
3. Sequence type↔Specifies a collection of objects ordered from left to right.
4. The \ character after the string literal extends the string to the follow line.
5. Len ()↔Used to find the length of a string.
6. []↔Help to find the specific character of the string.
7. String concatenation↔A program can add new characters to the end of a string in a process.
8. Container↔Is a construct used to group related values together and contains references to other
objects instead of data.
9. List↔Is a container created by surrounding a sequence of variables or literals with brackets [].
10. Element↔A list item.
11. Method↔Instructs an object to perform some action, and is executed by specifying the method
name following a "." symbol and an object.
12. Append()↔Is used to add new elements to a list.
o Elements can be removed using pop() or remove()

1. pop()↔Removes the element at the given index from the list.


2. remove()↔Removes the first element with a given value.

1. Sequence-type functions↔Built functions that operate on sequences like lists and strings.
2. Sequence-type methods↔Methods built into the class definitions of sequences like lists and
strings.
3. Tuple↔Stores a collection of data, like a list, but is immutable, once created, the elements cannot
be changed
4. Named tuple↔Allows the programmer to define a new simple data type that consists of named
attributes.

1. namedtuple()↔Creates only the new simple data type and does not create new data objects.
5. Set()↔Unordered collection of unique elements.

o Removes duplicated elements.


6. Set literal↔can be written using curly braces {{5333301327571283::{}}} with commas
separating set elements.
7. Add()↔Places a new element into the set if the set does not contain an element with the provided
value.
8. Remove() , pop()↔Removes an element from a set.
9. Dictionary↔Is a python container used to describe associative relationships. A dictionary is
represented by the dict object type.
10. Key↔Is a term that can be located in a dictionary.
11. Value↔Describes some data associated with a key, such as a definition.
12. Curly Braces {}↔To surround the key:value pairs that comprise the dictionary contents.
13. Numeric Types↔Int and float represent the most common types used to store data.
14. Sequence types↔String, list, and tuple are containers for collections of objects ordered by position in
the sequence, where the first object has an index of 0 and subsequent elements have indices 1,2,etc.
15. Mapping type↔Python is the dict type. Dict serves as a container.
16. Int()↔SIN PUNTO DECIMAL.
17. Float()↔CON PUNTO DECIMAL.
18. Str()↔COMILLAS.
19. Binary number↔Processor stores a number using a base 2.
20. Decimal number↔Each digit must be 0-9, and each digit's place is weighed by increasing powers of
10.
21. F-string↔Allows a programmer to create a string with placeholder expressions that are evaluated as
the program executes.
22. Replacement field↔It's value replaces the expression in the final output.
23. Format specification↔Allows a value's formatting in the string to be customized.
24. Presentation type↔Part of the format specification that determines how to represent a
value in text form, such as an integer, floating point, etc.
25. Type conversion↔Conversion of one type to another, such as an integer to a float.
26. Implicit conversion↔Type of conversion automatically made by the interpreter, usually
between numeric types.

You might also like