Comp lecture 2 - Variable types Flashcards

0
Q

Literals

A

Literals are constant values

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
1
Q

Variable

A

Variables are names for values

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Operator

A

An Operator is in between two arguments and performs a particular operation on the two arguments

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Assignment

A

When the variable is assigned or equated to a value

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Syntax rules for python’s variable names

A
  • the first character should always be an underscore or an alphabet
  • following characters can be alphabets, digits or underscores
  • meaningful names that make the program readable to others
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the PEMDAS rule and where is it used?

A

Parentheses > exponents > (multiplication,division) > (addition, subtraction)
It used for evaluating expressions constituting of more than one operators - tells us which operation to perform first

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is an object? What is the characteristic of an object and how does this characteristic help us?

A

Every value python can compute is an object.
Every object has a type.
And this tells us the different operations we can perform on the object

How well did you know this?
1
Not at all
2
3
4
5
Perfectly