What Is It In Code? Flashcards

1
Q

Addition

A

+

E.g 2+2

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

And

A

And

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

Division

A

/

E.g 2/6

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

Less than

A

<

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

Less than or equal to

A

<=

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

Greater than

A

>

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

Greater than or equal to

A

> =

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

Not equal to

A

!=

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

Equal to

A

==

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

Multiplication

A

*

E.g 4*4

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

Modulus

A

%

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

Not

A

Not

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

Or

A

Or

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

Parens

A

( )

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

String

A

Str

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

Subtraction

A

E.g 6-4

17
Q

Truncating division

A

/ /

18
Q

Unary Operations

A

-X, +X

A unary operator is an operator which works on a single operand. Python support unary minus operator(-). When an operand is preceded by a minus sign, then the unary operator negates its value. For example, if a number is positive, it becomes negative when the number is preceded by the unary operator.

19
Q

A real value (decimal) or a

Floating-point number

A

Float

20
Q

A number with no decimal (integer)

A

Int

21
Q

A dictionary (A set of key, value pairs)

A

Dict

22
Q

How do you initiate using the REPL “Read-Eval-Print-Loop”

A

To use the REPL, type python in your console. You will get is a prompt similar to the below output, which then waits for you to input commands:
Output

Python 3.9.5 (default, May 27 2021, 19:45:35)
[GCC 9.3.0] on linux
Type “help”, “copyright”, “credits” or “license” for more information.
»>

23
Q

The REPL has a built-in help function you can use to look up keywords and functions.

E.g If object was a specific function or keyword you wanted help on what would you type into the console?

A

The generalized syntax for this function is:

help([object])

Where [object] is a specific function or keyword you want help on.

Template:
help([ ])

24
Q

How do you enter the interactive help console without inputting the help option (Python)?

A

help()

If you don’t pass an argument to the help function, Python will start an interactive help.
You enter the interactive help console by typing help(). This command will list some basic instructions on how to use the help system.
From here, you can just type in the element you’re interested in. By, for example, typing string will display information about the topic string, which looks something like this:
Output

Copy
Help on module string:

NAME
string - A collection of string constants.

MODULE REFERENCE
https://docs.python.org/3.5/library/string.html

The following documentation is automatically generated from the Python
source files.  It may be incomplete, incorrect or include features that
are considered implementation detail and may vary between Python
implementations.  When in doubt, consult the module reference at the
location listed above.
25
Q

REPL commands:

When there is more than one page of output, you can press _____ to display line-by-line, or _____ to go page-by-page.

A

Enter

Space

26
Q

REPL commands:

At the end of the help screen, you can type _ to exit the page. You will be returned to the interactive help prompt.

A

q