Python 4.12 -4.18

Ace your homework & exams now with Quizwiz!

A called function's stack frame is popped when the function is called and exists while the function is executing

FALSE

Functional- style programming emphasizes mutability- it only uses operations that modify the variables values

FALSE

Identifiers defined outside any function (or class) have script scope- these may include functions, variables, and classes

FALSE

Like other popular languages, such as java and C#, Python is purely functional language

FALSE

Measures of dispersion help you understand how concentrated the values are

FALSE

Pure functions have side effects- for example, if you pass a mutable list to a pure function the list can obtain different values before and after the function call

FALSE

Python arguments are always passed by value

FALSE

The following session is a safe use of a wildcard import [in]: e = 'hello' from math import * e [out]: 2.71828182845

FALSE

The numpy module is typically imported with import as npy

FALSE

The smaller the variance and standard deviation are, the further the data values are from the mean and the greater overall dispersion there is between the values and the mean

FALSE

Two objects can reside at the same memory address

FALSE

After the preceding session, s contains 'HELLO'

FALSE

With pass-by-value the called function receives a copy of the argument s value and works exclusively with that copy. Changes to the called functions copy do not affect the original variable's value in the caller

True

You can access a global variable's value inside a function

True

You can import all identifiers defined in a module with a wildcard import of the form from Modulename import *

True

You've already used list, string, and built-in function range iterator with the for statement, and you've used iterators with several reductions

True

With pass- by reference, the called function can access the argument's value in the caller directly and modify the value if it's mutable

True

When a function call provides an argument, Python copies a reference to the argument object- not the object itself- into the corresponding parameter- function often manipulate large object

True

When a function returns, it no longer needs its local variables, so its stack frame is popped from the stack, and its local variables no longer exist

True

The following code calculates the population standard deviation with the statistics module's pstdev function: statistics.pstdev({ 1,3,4,2,6,5,3,4,5,3})

True

The integer result of calling id is known as the objects identity

True

The standard deviation is the square root of the variance, which tones down the effect of the outliers

True

The top stack frame always contains the information the currently executing function needs to return control to its caller

True

Though we can't see an object's address, we can use the built-in id function to obtain a unique int value that identifies only that object while it remains in memory

True

To modify a global variable in a function's block you must use a global statement to declare that the variable is defined in the global scope

True

Typically library code handles the how for you, The can eliminate many errors

True

Typically when importing a module, you should use import or import..... as statement

True

Variables with global scope are know as global variables

True

A called function's stack frame is the perfect place to reserve memory for the function's local variable

True

A local variable can only be used inside the function that defines it

True

A local variable's identifier has a local scope. It goes out of scope when the function returns to its caller

True

By default, you cannot modify a global variable in a function- when you first assign a value to a variable in a function's block, Python creates a new local variable

True

Each identifier has a scope that determines where you can where you can use it in your program. For that portion of the program, the identifier is said to be "in scope"

True

For each function call the interpreter pushes a stack frame onto the stack . This entry contains the return location that the called function needs so it can return control to its caller.

True

Function are objects that you can pass to other functions as data

True

Functional style programming lets you say what you want it to do, hides the details of how to perform each task

True

Functional-style programs can be easier to parallelize to get better performance on today's multi-core processors

True

Identifiers with global scope can be used in a .py file or interactive session anywhere after they're defined

True

If before a function returns it makes a call to another function the interpreter pushes a newly called function to return to its caller is now on top of the stack

True

In pure functional programming languages you focus on writing pure function. A pure functions result depends only on the arguments you pass to it.

True

Most functions have one or more parameters and possibly local variables that need to exist while the function is executing, remain active if the function calls to other functions

True

No two objects in memory can have the same identity

True

Polling organization tying to predict who will become next president work with small subsets of the population called samples.

True

When talking about a groups the entire group is called the population

True


Related study sets

Chapter 9 Commercial General Liability Coverage

View Set

Mitosis and Meiosis, Chapter 12 & 13

View Set