print() Flashcards

1
Q

built-in function that prints/outputs specified message to screen/console window

A

print()

the monks and septans writing out letters to be delivered by crow

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

Built in funcions are always available

A

do not require import

https://docs.python.org/3/library/functions.html

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

To call a function (this process is known as function invocation or function call), you need to use the function name followed by parentheses.

A

print(“Hello,”, “world!”). An “empty” print() function outputs an empty line to the screen.

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

“I am a string” (double quotes), or ‘I am a string, too’ (single quotes).

A

Python strings are delimited with quotes

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

Collections of instructions - commands to perform specific tasks

A

instructions

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

backslash \ special character that anounces newline character

A

Lieutenant Backsight Forethought (BF)

\n

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

dictated by their position, e.g., the second argument is outputted after the first, the third is outputted after the second, etc.

A

positional arguments

kama sutra

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

arguments are the ones whose meaning is not dictated by their location, but by a special word (keyword) used to identify them.

A

keyword arguments

Holy See

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

keyword argument parameters can be used for formatting the output of the print() function

A

end()

sep()

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

Keyword argument 3 elements

keyword (id of argument) == end

equal  sign =

value

must be place after the LAST positional argument

A

end and its rules

end=””

end=”***”

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

default behavior of end IMPLICITLY uses

end=”\n”

A

in a way that is not directly expressed

Varys
Littlefinger
Tyrion

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

something about print

is that hair gel

A

a print() function invoked with more than one argument outputs them all on one line;

the print() function puts a space between the outputted arguments on its own initiative.

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

keyword argument that separates its outputed arguments with spaces

A

sep

written as sep=”-“

print(“My”, “name”, “is”, “Monty”, “Python.”, sep=”-“)

My-name-is-Monty-Python.

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

Both the end and sep keyword arguments can be

A

mixed in one invocation

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

Keyword arguments are the ones whose meaning is not dictated by their location, but by a special word (keyword) used to identify them.

A

The end and sep parameters can be used for formatting the output of the print() function. The sep parameter specifies the separator between the outputted arguments, e.g., print(“H”, “E”, “L”, “L”, “O”, sep=”-“), whereas the end parameter specifies what to print at the end of the print statement.

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