# What will be the output of the following Python code import time for i in range(0,5): print(i) time.sleep(2)

1.  After an interval of 2 seconds, the numbers 1, 2, 3, 4, 5 are printed all together

2.  After an interval of 2 seconds, the numbers 0, 1, 2, 3, 4 are printed all together

3.  Prints the numbers 1, 2, 3, 4, 5 at an interval of 2 seconds between each number

4.  Prints the numbers 0, 1, 2, 3, 4 at an interval of 2 seconds between each number

4

Prints the numbers 0, 1, 2, 3, 4 at an interval of 2 seconds between each number

Explanation :
No Explanation available for this question

# What will be the output if we try to extract only the year from the following Python code (time.struct_time(tm_year=2017, tm_mon=6, tm_mday=25, tm_hour=18, tm_min=26, tm_sec=6, tm_wday=6, tm_yday=176, tm_isdst=0)) import time t=time.localtime() print(t)

1.  t[1]

2.  tm_year

3.  t[0]

4.  t_year

4

t[0]

Explanation :
No Explanation available for this question

# State whether true or false. s = time.time() t= time.time() s == t

1.  True

2.  False

2

False

Explanation :
No Explanation available for this question

# To include the use of functions which are present in the random library, we must use the option:

1.  import random

2.  random.h

3.  import.random

4.  random.random

4

import random

Explanation :
No Explanation available for this question

# The output of the following Python code is either 1 or 2. import random random.randint(1,2)

1.  True

1

True

Explanation :
No Explanation available for this question

# What will be the output of the following Python code import random random.choice(2,3,4)

1.  An integer other than 2, 3 and 4

2.  Either 2, 3 or 4

3.  Error

4.  3 only

4

Error

Explanation :
No Explanation available for this question

# What will be the output of the following Python code import random random.choice([10.4, 56.99, 76])

1.  Error

2.  Either 10.4, 56.99 or 76

3.  Any number other than 10.4, 56.99 and 76

4.  56.99 only

4

Either 10.4, 56.99 or 76

Explanation :
No Explanation available for this question

# What will be the output of the following Python function (random module has already been imported) random.choice('sun')

1.  sun

2.  U

3.  either s, u or n

4.  error

4

either s, u or n

Explanation :
No Explanation available for this question

# What will be the output of the following Python function, assuming that the random module has already been imported random.uniform(3,4)

1.  Error

2.  Either 3 or 4

3.  Any integer other than 3 and 4

4.  Any decimal value between 3 and 4

4

Any decimal value between 3 and 4

Explanation :
No Explanation available for this question

# Which module in Python supports regular expressions

1.  re

2.  regex

3.  pyregex

4.  none of the mentioned

4