IT first q Flashcards

1
Q

What do you call a value given to a function when it is run?

A

an arguement

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

What do you call one or more lines of code that perform a complete action?

A

a statement

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

What do you call a series of statements that has a name and performs some task?

A

a function

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

What do you call a value written out directly inside the code?

A

a literal

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

What what is an expression?

A

anything that can be turned into a value

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

How do you create a variable in Python?

A

with an assignment statement

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

Where do arguments appear in a call to a function?

A

inside parentheses right after the function name

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

What do you call a statement that gives a value to a variable?

A

an assignment statement

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

What do you call a location in RAM with a name that holds a value?

A

a variable

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

What do you call a statement that runs a function?

A

a function call

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

What do you call a sequence of characters?

A

a string

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

Is there a limit to the number of arguments you can use in a print function?

A

no

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

What is the name of the function used to read input from the keyboard?

A

Input

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

What is wrong with the following variable name?

1st_try

A

It begins with a number

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

Write an assignment statement that asks the user for an integer, converts it to the correct data type and assigns it to the variable number.

A

number = int(input(“Please enter an integer: “))

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

What are the four types of expressions?

A

literals, variables, calculations, function calls

17
Q

Name three data types.

A

Float, String, and integer

18
Q

What is the purpose of the argument to the function mentioned above?

A

text used to prompt the user for a value

19
Q

Write an assignment statement that asks the user for his or her name and assigns it to the variable name.

A

name = input(“Please enter your name: “)

20
Q

Write an assignment statement that asks the user for a decimal number, converts it to the correct data type and assigns it to the variable number.

A

number = float(input(“Please enter a decimal number: “))