Section 1

Preview this deck

You can use a variable in an expression with

Front

Star 0%
Star 0%
Star 0%
Star 0%
Star 0%

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Active users

6

All-time users

9

Favorites

0

Last updated

4 years ago

Date created

Mar 1, 2020

Cards (20)

Section 1

(20 cards)

You can use a variable in an expression with

Front

Other variables and values

Back

The * operator is used for multiplication when it operates on two integers or floating point values. However,

Front

When * is used on a string value along with an integer, it becomes the string replicator operator. >>>'Alice' * 5 AliceAliceAliceAliceAlice

Back

The meaning of an operator may change depending on

Front

The data type next to it

Back

Data type

Front

Category for values

Back

Overwriting a variable

Front

When a variable is assigned a new value

Back

Floating point numbers

Front

Values with a decimal point

Back

The + is the addition operator when it operates on two integers or floating point values. However,

Front

When + is used on two string values, it just places the two strings together >>>Alice + Bob AliceBob

Back

assignment statement

Front

Where you store values in variables

Back

Expressions

Front

Consist of values and operators

Back

Every value belongs to

Front

Exactly one data type

Back

Variable

Front

Where you store a single valuej

Back

Integers

Front

Values that are whole numbers ...-2,-1,0,1,2...

Back

Assignment statements consist of

Front

A variable name, an equal sign and the value to be stored. >>>spam = 40 >>>spam 40 >>>eggs = 2 >>>spam + eggs 42

Back

String

Front

A sequence of characters that is surrounded by single quotes

Back

variable initialization

Front

The first time a value is stored in a variable

Back

3 most common data types

Front

Integers Floating point numbers Strings

Back

If you use + to join an interger with a string

Front

Python will not know how to handle it and display an error message.

Back

Value

Front

A number

Back

Operators

Front

* / // % + -

Back

You could only use * for

Front

Two numeric values or with an integer with a string. Otherwise an error message will appear.

Back