Question 1 of 25
Hints left: 3
Q1
State whether true or false. s = time.time() t= time.time() s == t
Q2
What does the findall() function in the re module do?
Q3
What is the purpose of the re.IGNORECASE flag in Python?
Q4
What does the function re.search do?
Q5
Which type of elements are accepted by random.shuffle()?
Q6
What will be the output of the following Python code? from math import factorial print(math.factorial(5))
Q7
What will be the output of the following code: import random print(random.choice([1, 2, 3, 4]))
Q8
What is the output of the following code: import re result = re.sub(r'd+', 'number', 'There are 5 apples and 3 oranges.') print(result)
Q9
What does the match() function in the re module do?
Q10
Which of the following will throw an error if used after the following Python code? tday=datetime.date.today() bday=datetime.date(2017,9,18) t_day=bday-tday
Q11
What is the value of x if x = math.sqrt(4)?
Q12
Which of the following functions can be used to find the coordinated universal time, assuming that the datetime module has already been imported?
Q13
What will be the output of the following Python function, assuming that the random library has already been included? random.shuffle[1,2,24]
Q14
What is math.floor(0o10)?
Q15
The sleep function (under the time module) is used to . . . . . . . .
Q16
What is the output of the following code: import re result = re.findall(r'bw+b', 'Hello, world!') print(result)
Q17
What will be the output of the following Python code, if the code is run on Windows operating system? import sys if sys.platform[:2]== 'wi': print("Hello")
Q18
How can you search for a specific pattern in a string using regular expressions in Python?
Q19
How can you use regular expressions in Python?
Q20
What does the function re.match do?
Q21
Which of the following creates a pattern object?
Q22
Which module in Python supports regular expressions?
Q23
What is the purpose of the re.compile() function in Python?
Q24
What does os.close(f) do?
Q25
What is a regular expression in Python?