Function Arguments Flashcards

1
Q

def summation(num1,num2):
summation(10,20)

A

valid

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

def summation(num1,num2):
summation()

A

invalid
required positional argument

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

def summation(num1,num2):
summation(10)

A

invalid
required positional argument

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

def summation(num1,num2):
summation(10,20,30)

A

invalid
required positional argument

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

def summation(*nums):
summation()

A

valid
arbitrary positional argument

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

def summation(*nums):
summation(10)

A

valid
arbitrary positional

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

def summation(*nums):
summation(10,20,30,40,50,60)

A

valid
arbitrary positional

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

def summation(base, *nums):
summation()

A

invalid
positional & arbitrary

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

def summation(base, *nums):
summation(10)

A

valid

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

def summation(base, *nums):
summation(10,1,2)

A

valid

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

def summation(num1,num2):

summation(num1=10,num2=20)

A

valid
keyword argument

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

def summation(num1,num2):

summation(num2=10,num1=20)

A

valid
keyword argument
order does not matter

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

def summation(*nums):

summation(nums=5)

A

invalid
keyword plus arbitrary positional

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

def summation(*nums):

summation(nums=(5,6,7))

A

invalid
keyword & arbitrary positional

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

def power(base=10,exp=2):
power()

A

valid
default args

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

def power(base=10,exp=2):

power(5)

A

valid
default args

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

def power(base=10,exp=2):
power(5,7)

A

valid

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

def power(base=10,exp=2):
power(base=5)

A

valid

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

def power(base=10,exp=2):
power(exp=7)

A

valid

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

def power(base=10,exp=2):
power(base=5,exp=7)

A

valid

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

def power(base=10,exp=2):
power(exp=7,base=5)

22
Q

def power(base=10,exp=2):
Power(5,7,8)

23
Q

def power(base=10,exp=2):
power(exp=5,7)

A

invalid
positional before keyword

24
Q

def power(base=10,exp=2):
power(base=7,5)

25
def power(base=10,exp=2): Power(7,exp=5)
valid
26
def summation(base, *nums): summation(base=7,5,6,7) #invalid
invalid
27
def compute_size(length,width,height):
valid
28
def compute_size(length,width,height=5):
valid
29
def compute_size(length,width=10,height=5):
valid
30
def compute_size(length=15,width=10,height=5):
valid
31
def compute_size(length=7,width,height):
invalid
32
def compute_size(length,width=10,height):
invalid
33
def summation(base=5, *nums): summation(base=7,5,6,10)
invalid
34
def summation(base=5, *nums): summation()
valid
35
def summation(base=5, *nums): summation(7)
valid
36
def summation(base=5, *nums): summation(7,5,6)
valid
37
def summation(base=5, *nums): summation(base=7)
valid
38
def summation(base=5, *nums): summation(base=7,5,6,10)
invalid
39
def summation(base=5, *nums): summation(5,6,7,base=7)
invalid
40
def compute_size(length=10,*,width=5,height=7):
valid
41
def compute_size(length=10,*,width=5,height=7): compute_size(2)
valid
42
def compute_size(length=10,*,width=5,height=7): compute_size(length=2,width=5,height=3)
valid
43
def compute_size(length=10,*,width=5,height=7): compute_size(2,width=6,height=8)
valid
44
def compute_size(length=10,*,width=5,height=7): compute_size(3,height=2,width=4)
valid
45
def compute_size(length=10,*,width=5,height=7): compute_size(height=2,width=4,length=5)
valid
46
def compute_size(length=10,*,width=5,height=7): compute_size(2,4)
invalid
47
def compute_size(length=10,*,width=5,height=7): compute_size(2,4,height=3)
invalid
48
def compute_size(length=10,*,width=5,height=7): compute_size(length=2,4,height=3)
invalid
49
50