Python programming quiz: trivia test! There are a lot of people who think python is hard to understand, but it is actually the easiest to understand for beginners. Do you think you have enough basic knowledge about the program to answer all the questions in this quiz? Do give it a shot and see if you might need a refresher to understand the programming language much better. All the best!
SPAM23
23spam
Spam
_spam
5
4
2.0
5.0
1
3
2
6
A
N
B
Syntax error
Looks up ‘None’ in the smallest variable if it is a string
The if statement is a syntax error
Matches both type and value
Is true if the smallest variable has a value of -1
Type()
Convert()
Trans()
Map()
T[2:2]
T[2:4]
T[2:3]
T[12:3]
Print(sum([int(num) for num in re.findall('[0-9]+',fh.read())]))
Print(sum([int(num) for num in re.findall('[0-9]+')].fh.read()))
Print(sum([int(num) for num in re.findall('[0-9]+')],fh.read()))
Print(sum(int(num) for num in re.findall('[0-9]+',fh.read())))
Counts[key] = counts.get(key,0)+1
Counts[key] = (counts[key]*1)+1
Counts[key] = (key in counts)+1
Counts[key] = counts.get(key,-1)+1
A list of tuples
A list of integers
A list of strings
A tuple with three integers
It sorts the dictionary based on its key values
It computes the largest of all of the values in the dictionary
It creates the list of tuples where each tuple is a value, key pair
It computes the average of all of the values in the dictionary
For a temporary variable that you will use and discard without modifying
For a list of items that want to use strings as key values instead of integers
For a list of items you intend to sort in place
For a list of items that will be extended as new items are found
For i in event.items(): for k in range(len(i)): val = list(i[k].values()) for j in val: print(j)
For i in event.values(): for k in range(len(i)): val = list(i[k].values()) for j in val: print(j)
For i in event.values(): for k in range(len(i)): val = list(i[k].items()) for j in val: print(j)
For i in event.items(): for k in range(len(i)): val = list(i[k].items()) for j in val: print(j)
While ((line = fl.readLine()) != null) {
Read fl into line
For line in fl:
While (<fl>) {
File
Let
With
As