Busy. Please wait.
Log in with Clever
or

show password
Forgot Password?

Don't have an account?  Sign up 
Sign up using Clever
or

Username is available taken
show password


Make sure to remember your password. If you forget it there is no way for StudyStack to send you a reset link. You would need to create a new account.
Your email address is only used to allow you to reset your password. See our Privacy Policy and Terms of Service.


Already a StudyStack user? Log In

Reset Password
Enter the associated with your account, and we'll email you a link to reset your password.

Python

Quiz yourself by thinking what should be in each of the black spaces below before clicking on it to display the answer.
        Help!  

Question
Answer
object   In Python every value is stored in memory as an object. It is useful to think of an object as a container for the value that sits inside your computer's memory.  
🗑
object type   indicates kind of values object can hold and operations that can be performed on the object. Examples: integer (int), floating point (float), Boolean (bool), string (str), and list (list) type() function can be used to determine an object's type  
🗑
variable and object type   variables do not have types the objects variables refer to have types  
🗑
object-oriented   Python programming language is said to be object-oriented because values are always stored in objects. In programming languages other than Python, values of certain types are not stored in abstract entities such as objects but explicitly in memory.  
🗑
class   The term class is used to refer to types whose values are stored in objects. Because every value in Python is stored in an object, every Python type is a class. In this book, we will use class and type interchangeably.  
🗑
float   represents real numbers as fractions with finite decimal representations  
🗑
number type and algebraic expressions   If both operands x and y (are integers, the result is an integer. If one of the operands is a float value, the result is a float value. For division (/), the result is a float value, regardless of the operands.  
🗑
7 comparison operators for numbers   < Less than <= Less than or equal > Greater than >= Greater than or equal == Equal != Not equal  
🗑
constructor   explicitly instantiate object type x = int() float(), list(), and str()  
🗑
Implicit type conversion   float contains integer contains boolean If an algebraic or logical expression involves operands of different types, Python will convert each operand to the type that contains the others.  
🗑
Operator Precedence   List definition Indexing operator Exponentiation Positive, negative signs Product, division, integer division, remainder Addition, subtraction Comparisons, including membership and identity tests Boolean NOT Boolean AND Boolean OR  
🗑
Explicit Type Conversions   >>> int(3.4) 3 >>> float(3) 3.0 >>> str(2.72) ‘2.72’  
🗑
methods   We have a list object, pets, followed by a dot (.), followed by the method (function) call. EX: pets.append(‘guinea pig’) The list method append() is called on the list object pets with string input ‘guinea pig’.  
🗑
Python Standard Library   Consists of thousands of functions and classes organized into components called modules that relate to particular application domain. More than 200 built-in modules together form the Python Standard Library.  
🗑
Module math   To use a math module function >>> import math sqrt(x) ceil(x) (i.e., the smallest integer = x) floor(x)(i.e., the largest integer = x) cos(x) cos(x) sin(x) sin(x) log(x, base) logbase(x) pi 3.141592653589793 e 2.718281828459045  
🗑
Module fractions   >>> import fractions >>> a = fractions.Fraction(3, 4) >>> b = fractions.Fraction(1, 2) As with other numbers, Fraction objects can be added, and the result is a Fraction object: >>> c = a + b >>> c Fraction(5, 4)  
🗑
float vs fraction   the range of values that float objects can store is limited The range of values representable with fractions.Fraction objects is much, much larger and limited only by the available memory expressions involving float values evaluate much faster  
🗑


   

Review the information in the table. When you are ready to quiz yourself you can hide individual columns or the entire table. Then you can click on the empty cells to reveal the answer. Try to recall what will be displayed before clicking the empty cell.
 
To hide a column, click on the column name.
 
To hide the entire table, click on the "Hide All" button.
 
You may also shuffle the rows of the table by clicking on the "Shuffle" button.
 
Or sort by any of the columns using the down arrow next to any column heading.
If you know all the data on any row, you can temporarily remove it by tapping the trash can to the right of the row.

 
Embed Code - If you would like this activity on your web page, copy the script below and paste it into your web page.

  Normal Size     Small Size show me how
Created by: kbaldwin
Popular Computers sets