What will be the output after the following statements? b = 3 for a in range(10, 1): b -= a + 1 print(b) a. 7 b. 4 c. 3 d. 8
What will be the output after the following statements? b = 1 for a in range(1, 5): b *= a + 1 print(b) a. 120 b. 40 c. 36 d. 250
What will be the output after the following statements? a = True print(a and not a) a. a b. False c. not a d. True
What will be the output after the following statements? a = True b = False print(a == b or not b) a. a == b b. False c. not b d. True
What will be the output after the following statements? a = ‘Hello’ b = ‘hello’ print(a is b) a. a is b b. False c. not b d. True
What will be the output after the following statements? a = ‘Python’ b = ‘Python’ print(a is b) a. a is b b. False c. not b d. True
What will be the output after the following statements? a = [4, 7, 9] b = [4, 7, 9] print(a is b) a. a is b b. False c. not b d. True
What will be the output after the following statements? a = [4, 7, 9] b = [7, 4, 9] print(a is not b) a. a is b b. False c. not b d. True
What will be the output after the following statements? a = [3, 6, 9] b = [3, 6, 9] print(a is b, a == b) a. True True b. False False c. False True d. True False
What will be the output after the following statements? a = 0 b = 5 c = 10 a = b b = c c = a print(a, b, c) a. 0 5 10 b. 5 10 10 c. 5 10 5 d. 5 5 10
What will be the output after the following statements? b = 15 c = 20 a = b b = c c = a print(b, c) a. 20 15 b. 15 20 c. a 20 d. 15 a
In IDLE shell, the output will be the same for all the following statements except one. Which one? a. 4*3 b. 60//5 c. 17-5 d. 12/1
In IDLE shell, the output will be an error for one of the following statements. Which one? a. P = ‘python’ * int(‘1’) b. P = ‘python’ + 1 c. P = ‘python’ + str(1) d. P = ‘python’ * 1
What will be the output after the following statements? a = 4**3 b = pow(4,3) print(a, b) a. 4 4 b. 4 3 c. 12 12 d. 64 64
What will be the output after the following statements? a = min(10, 15, 6, 17, 24) print(a) a. (10, 15, 6, 17, 24) b. 6 c. 5 d. 24
What will be the output after the following statements? a = [4, 25, 16, 9, 24] print(max(a)) a. [4, 25, 16, 9, 24] b. 9 c. 25 d. 24
What will be the output after the following statements? a = round(5.3) b = round(5.6) c = round(5.5) print(a, b, c) a. 5 5 5 b. 6 5 6 c. 5 6 6 d. 5 6 5
How many times will “Python 3” be printed after the following statements? for i in range(1, 5): print(‘Python 3’) a. 3 b. 4 c. 5 d. 6
What will be the output after the following statements? a = round(4.49999) print(a) a. 4 b. 5 c. 4.0 d. 4.5
What will be the output for a function that does not return any value? a. None b. No value c. Zero d. Bool
What type of error will be shown after the following statement? a = b a. SyntaxError b. TypeError c. ValueError d. NameError
What type of error will be shown after the following statement? a = int(‘hello’) a. SyntaxError b. TypeError c. ValueError d. NameError
What type of error will be shown after the following statement? a = {7) a. SyntaxError b. TypeError c. ValueError d. NameError
What type of error will be shown after the following statement? a = ‘Python’ + 3 a. SyntaxError b. TypeError c. ValueError d. NameError
What is the data type of a after the following statement? a = {‘A’, ‘B’, ‘C’, ‘D’} a. List b. Dictionary c. Tuple d. Set
What is the data type of a after the following statement? a = {‘A’:1, ‘B’:2, ‘C’:3, ‘D’:4} a. List b. Dictionary c. Tuple d. Set
What is the data type of a after the following statement? a = (1, 4, 3, 6) a. List b. Dictionary c. Tuple d. Set
What is the data type of a after the following statement? a = [1, 4, 3, 6] a. List b. Dictionary c. Tuple d. Set
What is the data type used to store values in key values pair? a. List b. Dictionary c. Tuple d. Set
In IDLE shell, which of the following statements gives SyntaxError? a. “Python\tis\tEasy\n” b. “Hello, it’s very easy to learn Python” c. “Python”, “easy” d. “Python is easy’
What will be the output after the following statements? a = 45 b = 55 c = (a + b) / 2 print(c) a. 45 b. 50.0 c. 45.0 d. 55.0
Which of the following has the highest precedence in an expression? a. Parentheses b. Exponential c. Division d. Subtraction
What will be the output after the following statements? a = 4*3**2 print(a) a. 32 b. 144 c. 36 d. 24
What is the name of Python’s built-in module for regular expressions? a. regex b. regexes c. REG d. re
What is the name of Python’s built-in module for delimited files? a. csv b. tsc c. delimited d. pipe
What is the name of Python’s built-in module for basic date and time types? a. date b. time c. datetime d. dates
What is the name of Python’s built-in module for email related tasks? a. mailserver b. email c. message d. mail
What is the name of Python’s built-in module for reading passwords? a. getpass b. password c. login d. readpass
What is the name of Python’s built-in module for IPv4/IPv6 manipulation? a. getip b. ipman c. ip d. ipaddress
What is the name of Python’s built-in module for encoding/decoding JSON format? a. json b. jcode c. jsonencode d. jsoncode
What is the name of Python’s built-in module for Python keywords? a. string b. keyword c. stringtest d. keytest
What is the name of Python’s built-in module for mathematical functions? a. maths b. mathematics c. math d. mathfunc
What is the name of Python’s built-in module for operating system interfaces? interfaces? a. windows b. liunx c. operatingsystem d. os
What is the name of Python’s built-in module for data pretty printer? a. pprint b. print c. prettyprint d. printp
What is the name of Python’s built-in module for generating pseudo-random numbers? a. psrandom b. random c. psuedo d. randomnum
What is the name of Python’s built-in module for general purpose event scheduler? a. scheduler b. eventsched c. sched d. schedule
What is the name of Python’s built-in module for high level file operations? a. shutil b. fileutil c. futility d. fileop
What is the name of Python’s built-in module for low level networking interface? a. net b. socket c. webking d. webworking
What is the name of Python’s built-in module for SQLite databases? a. SQL b. sqldb c. dbase d. sqlite3
What is the name of Python’s built-in module for TLS/SSL wrapper for socket objects? a. ssl b. swrap c. tlsssl d. sslobj