Python 3 Flashcards

1
Q

Python User Input Functions

A
  1. input()
  2. raw_input()
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

function is used to take input from the user. It always returns the input as a string, regardless of what the user enters.

A

input()

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

function is similar to input() in Python 3.x. It reads a line from input, converts it to a string, and returns it. It doesn’t try to evaluate the input, making it safer for general use.

A

raw_input()

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

To add an item to the end of the list

A

append()

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

To insert a list item at a specified index

A

insert()

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

To append elements from another list to the current list, use the

A

extend()

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

method removes the specified item.

A

remove()

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

method removes the specified index.

A

pop()

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