Basic Concepts Flashcards

Basic Concepts

1
Q

Numeric Operators definition
(**, *, %, //, +, -)

A

** - power (2**3 = 8)
/ - divisor ( 5/2 = 2)
% - modulus (5%2 = 1)
// - floor division, returns an integer rounded down

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

String operators definition
*, +

A
    • multiplies the string e.g. ‘do’ * 2 = dodo

+ - adds string, e.g ‘add’ + ‘er’ = adder

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

assignment and shortcut operators
=, -=, +=, *=, /=, %=

A

a += b => a + b =

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