It101-1l lesson 3-5 Flashcards

1
Q

are essential in programming as they allow programs to display information to the user

A

Output operations

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

displaying output to the screen or console can be achieved using the

A

print function

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

the ______ character is used to insert a newline in the output.

A

\n

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

specifies what to print at the end of the output.

A

end parameter

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

are special character combinations that allow you to represent characters that are difficult to type or have a special meaning within a string

A

Escape sequences

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q
  • Moves the cursor to the beginning of the next line.
A

\n: Newline

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

Inserts a horizontal tab.

A

\t: Tab -

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q
  • Inserts a double quote character.
A

\” : Double quote

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q
  • Inserts a single quote character.
A

\’: Single quote

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

Inserts a backslash character.

A

\\: Backslash -

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

\n what is this called?

A

new line

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

\t what is this called?

A

tab

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

" What is this called?

A

double quote

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

' what is called?

A

single quote

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

\ what is this called?

A

Backslash

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

allow you to specify where and how the values of variables should be inserted into the output.

A

Placeholders

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

are used within output statements to indicate the position and format of variable values.

A

Placeholders

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

%d:

A

Signed integer

19
Q

%f:

A

Floating-point number

20
Q

%s:

A

String

21
Q

function to accept user input

A

input()

22
Q

function to convert the string to an integer so that we can perform numerical operations with it.

A

int()

23
Q

Adds two values together.

A

Addition (+):

24
Q

: Subtracts one value from another.

A

Subtraction (-)

25
Q

Multiplies two values.

A

Multiplication (*):

26
Q

Divides one value by another.

A

Division (/):

27
Q

Computes the remainder after division.

A

Modulus (%):

28
Q

Divides one value by another and returns the integer quotient.

A

Floor Division (//):

29
Q

Raises one value to the power of another.

A

Exponentiation (**):

30
Q

Operator precedence?

A
  1. Exponentiation (**)
  2. Unary operators (e.g., -x, +x)
  3. Multiplication (*), Division (/), Floor Division (//), Modulus (%)
  4. Addition (+), Subtraction (-)
31
Q

are used to assign values to variables in programming language

A

Assignment operators

32
Q

is used to assign a value to a variable.

A

The basic assignment operator (=)

33
Q

): It multiplies the variable on the left-hand side by the value on the right-hand side and assigns the result to the left-hand side variable.

A

Multiplication Assignment Operator (*=

34
Q

It divides the variable on the left-hand side by the value on the right-hand side and assigns the result to the left-hand side variable

A

Division Assignment Operator (/=):

35
Q

It performs floor division on the variable on the left-hand side by the value on the right-hand side and assigns the integer quotient to the left-hand side variable.

A

Floor Division Assignment Operator (//=):

36
Q

It computes the remainder when the variable on the left-hand side is divided by the value on the right-hand side and assigns the result to the left-hand side variable

A

Modulus Assignment Operator (%=):

37
Q

are used to manipulate individual bits of binary numbers in computer programming.

A

Bitwise operators

38
Q

compares two bits and returns 1 if both bits are 1, otherwise returns 0

A

AND Operator (&):

39
Q

_________ compares two bits and returns 1 if at least one of the bits is 1, otherwise returns 0.

A

OR Operator (|):

40
Q

compares two bits and returns 1 if the bits are different (one 0 and the other 1), otherwise returns 0.

A

XOR Operator (^):

41
Q

flips the bits, turning 0 to 1 and 1 to 0.

A

Complement Operator (~):

42
Q

shifts the bits of a number to the left by a specified number of positions, effectively multiplying the number by a power of 2.

A

Left Shift Operator («):

43
Q

shifts the bits of a number to the right by a specified number of positions, effectively dividing the number by a power of 2.

A

Right Shift Operator (»):

44
Q
A