• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/20

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

20 Cards in this Set

  • Front
  • Back
variable assignment
References to a part of the program memory, and each variable has a name and an associated value.

Variables are created by using the equal sign.

You are assigning a value to a variable.
data types
The type of a variable's value indicates whether the value is an

integer
float
string
boolean
or a more complicated piece of data
Name the types of numbers referred to in Python
integer - a number without a decimal component

float - short for floating point, the system used for keeping track of the decimal point in the internal representation of numbers on a computer. a number with a decimal point.
function
a separate piece of code somewhere that you can use by calling it, possibly with parameters.

Example: the Python function TYPE tells us the type of a value.
string
text
boolean
abbreviated to 'bool'

a value that is either True or False
what symbol denotes equality?
==
double equal
what symbol denotes variable assignment?
=
single equal
What does the following denote?

"Alexander" == "alexandER"
That equality of a string is dependent on the capitalization of the two strings being compared.

Two strings are equal only if all the individual characters in the string are equal.

Use of quotes have no effect on the strings.
What does this symbol mean?

!=
not-equal-to
Give me the integer representation of the value:

12.0
12
Give me the float representation of

21.3
21
What happens with converting a float type to int type?
Python strips away the decimal component and rounds down
What does the string conversion function called?

What does it do?
It is called str

It accepts a single parameter.
It converts any int or float into a string.
What are function names and type names in Python?
They are really just variable identifiers.

They point to functions or to types instead of numbers or strings.
What happens when you declare a variable to a type, like int?
Python allows that but then the function int cannot be called because it is no longer a function because we redefined int as an actual number, so all of the functionality that was built in before is now gone.
How do you fix a function that was accidentally overwritten?
Quit and restart the IDLE interpreter
or
Restart Shell
What is a variable?
A reference to a value.
what is program state or program memory?
The collection of variables in a programming language.
In Python, a variable is restricted to holding values of a particular type. TRUE OR FALSE?
FALSE

In Python, a variable is not restricted to holding values of a particular type. However, each value has a particular type associated with it, and can be tested for equality, and the type of the value has meaning when checking if two pieces of data are equal to one another.