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