ADV PROG DAY 4 Flashcards

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.

A

list.pop()

24
Q

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

A

list.sort()

25
Q

Returns the index position of the first item located within the list equal to the object value.

A

list.index()

26
Q

Equivalent to

A

==

27
Q

Not Equivalent to

A

!=

28
Q

Greater than

A

>

29
Q

Greater than or equivalent to

A

> =

30
Q

less than

A
31
Q

less than or equivalent to

A

<=

32
Q

is in the container

A

in

33
Q

is not in the container

A

not in

34
Q

Both conditions must be true

A

and

35
Q

One or the other condition must be true

A

or

36
Q

Invert the boolean value

A

not

37
Q

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.

A

File I/O

38
Q

Read mode

A

r

39
Q

Write mode

A

w

40
Q

Appends to the end of the file

A

a

41
Q

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)

A

b