Question: Python Programming Language 1- The variable release_year_dictis a Python Dictionary, the result of applying the following method: keys(), is to retrieve the keys. (True, False).
Python Programming Language
1- The variable release_year_dictis a Python Dictionary, the result of applying the following method: keys(), is to retrieve the keys. (True, False).
2- Consider V={'A','C'}, the result of add('B'), is V={'A', 'B', 'C'}. (True, False)
3-
x=0
while(x<2):
print(x)
x=x+1
results: 0, 1, 2 (True, False)
4- def function(x):
if x==0:
y=1
else:
y=0
return(y)
this function returns 1 always if the input is zero. (True, False)
5- Python has integer, float, and string data types, concatenate any of those data types are accepted (like string + float). (True, False)
6- Tuple is immutable while list is mutable. (True, False)
7- A=[n1, n1, n3, n3, n4, n4], to remove the duplicates of list A, we can use the following code A=list(set(A)). (True, False)
8-
def find_FL(list1):
length = len(list1)
list1.sort()
print("Largest element is:", list1[length-1])
print("Smallest element is:", list1[0])
*All good with the above function. (True, False).
9-
def range_F2L2(list1):
largest = list1[0]
largest2 = list1[0]
lowest = list1[0]
lowest2 = list1[0]
for item in list1:
if item > largest:
largest = item
elif largest2!=largest and largest2 < item:
largest2 = item
elif item < lowest:
lowest = item
elif lowest2 != lowest and lowest2 > item:
lowest2 = item
print("Largest element is:", largest)
print("Smallest element is:", lowest)
print("Second Largest element is:", largest2)
print("Second Smallest element is:", lowest2)
*All good with the above function. (True, False).
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
