Python Millionare
1.02K subscribers
477 photos
1 link
Small tasks, four answers
Download Telegram
WEAKLY PYTHON MILLIONAIRE DIGEST 5.12-11.12.2022

~ Topic #14 “Additional chapters: re”
~ Average accuracy 29%
~ Average involvement 12 people (4%)

N.B.

🐍 re.findall() returns a list of all occurrences according to the given pattern
🐍 re.match() will search the pattern and return the first occurrence at the beginning of the string
🐍 re.search() will search the pattern and return the first occurrence as well, but, unlike re.match(), it will check all the lines of the input string()
🐍 Ordinary characters (letters (a, A), digits(9)) match themselves exactly. The meta-characters(^$*+?{}[]()\|) do not match themselves, because they have special meanings (e.g. + - match 1 or more occurrences, * - 0 or more occurrences, ? - 0 or 1 occupancies of the pattern)
137. What will be the last row of the table after the program is executed?
Anonymous Quiz
47%
3 6 BobSallyScott 17020
22%
3 2.0 NaN 5673.333333
22%
3 6 NaN 17020
8%
3 6 BobSallyScott 5673.333333
138. What will be printed when the following code is executed?
Anonymous Quiz
41%
2529
36%
C2H5OH or 32=9
12%
54
10%
3
139. What will be printed when the following code is executed?
Anonymous Quiz
20%
error
51%
0,4
11%
4:0
18%
1,7
140. What will be printed when the following code is executed?
Anonymous Quiz
44%
TrueTrueTrueTrueTrue
14%
0
25%
5
18%
error
141. What will be printed when the following code is executed?
Anonymous Quiz
11%
error
21%
''
24%
'Sing with me, '
44%
'and sing it for the tear. '
142. What will be printed when the following code is executed?
Anonymous Quiz
18%
['Monica ', ', ', 'Rachel ']
44%
Monica,,,Rachel
26%
Monica , Rachel
12%
Monica,,Rachel
WEAKLY PYTHON MILLIONAIRE DIGEST 12.12-18.12.2022

~ Topic #15 “Topics Recap”
~ Average accuracy 32%
~ Average involvement 24 people (9%)

N.B.

🐍 The sum() method adds all values in each column and returns the sum for each column. Keep in mind that str values will also be added, meaning concatenation (e.g. sum of a column containing names will be a string containing all the names)
🐍By multiplying a boolean value by number we receive a number (1 or 0)
🐍 Splitting the string by spaces, all the elements from the string will get into the list, including punctuation marks - they will be treated as equivalent signs (e.g. “one , three”.split() gives you [“one”, “,”, “three”] - a list that actually contains three elements, even though there were only two words in a sentence)