ADV PROG DAY 4 Flashcards

(41 cards)

1
Q
  • An object-oriented interpreted language, used throughout CNO mission areas for building CNO analysis tools and testing applications.
  • An easy to learn programming language with decreased complexity, code-writing efficiency, limitless third-party libraries, and is available on most UNIX workstations.
A

python

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

display information on the monitor using Python.

automatically inserts a once the string has been displayed.

use a comma so output from two or more print statements can share the same line.

A

Print

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

character.

A

\n

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

Tab character. The width of the tab is set by the terminal program, not the Python script, although it is typically eight spaces.

A

\t

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

Removes the meaning of the quote so it can be used as part of the string.

A

\” or \’

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

Backspace. Removes previous character from string.

A

\b

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

Attempts to convert the providedobject into a string.

A

str()

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

Attempts to convert the provided object into an integer.

A

int()

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

Attempts to convert the provided object into a float.

A

float()

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

Returns a sequenced list of elements from the object passed.

A

list()

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

Returns the data type of the object passed.

A

type()

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

Exits the Python script and returns a number to the terminal.

A

exit()

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

Displays the help page from the Python documents.

A

help()

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

Displays the number of elements in a set, like a list or a string.

A

len()

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

takes exactly what is typed and passes it back as a string. It does not interpret the user input.

Whether an integer value or a list is entered, its type is of string only.

A

raw_input( )

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

Returns a copy of the string with each letter capitalized.

A

string.upper( )

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

Returns a copy of the string with each letter in lowercase.

A

string.lower( )

18
Q

Returns the first index position where the substring is found. Returns -1 if the substring is not found.

A

string.find()

19
Q

Returns the string as a list delimited by the value passed as an argument, with a default of a whitespace.

A

string.split()

20
Q

Returns the string with the last character removed.

A

string.strip()

21
Q

Appends an object to the end of the list.

A

list.append()

22
Q

Removes the first element from the list specified by the object value.

A

list.remove()

23
Q

Deletes an element via index position.

24
Q

Sorts all the items and updates the list at the same time.

25
Returns the index position of the first item located within the list equal to the object value.
list.index()
26
Equivalent to
==
27
Not Equivalent to
!=
28
Greater than
>
29
Greater than or equivalent to
>=
30
less than
31
less than or equivalent to
<=
32
is in the container
in
33
is not in the container
not in
34
Both conditions must be true
and
35
One or the other condition must be true
or
36
Invert the boolean value
not
37
allows programs to create, read, modify, and delete files within directories. Python uses open() to request a file handle from an OS. If the open()fails, an IOError exception is raised.
File I/O
38
Read mode
r
39
Write mode
w
40
Appends to the end of the file
a
41
Used in conjunction with any of the above modes to allow non-text files to be opened(e.g., image files like JPEGs or GIFs, audio files like MP3s,or binary document formats like Word or PDF)
b