Test
Python IITU 2017
Crea una cuenta gratis para terminar este test
Guarda tu progreso y consulta tu resultado final.
¿Ya tienes cuenta? Inicia sesión
Preguntas del test (180)
11. What is the output of print str if str = 'Hello World!'?
- AHello World
- BHello World!
- CWorld
- D‘Hello World!’
2What is the output of print str * 2 if str = 'Hello World!'?
- AHello World
- BHello World! Hello World!
- CWorld
- D‘Hello World! Hello World
3Which of the following is correct about dictionaries in python?
- APython's dictionaries are kind of hash table type
- BThey work like associative arrays or hashes found in Perl and consist of key-value pairs
- CA dictionary key can be almost any Python type, but are usually numbers or strings. Values, on the other hand, can be any arbitrary Python object
- DAll of the above
4What is the output of print tinylist * 2 if tinylist = [123, 'john']?
- A[123, ‘john’, 123, ‘john’]
- B[123, 'john'] * 2
- CError
- D[123, 'john']
5What is the output of print str[2:] if str = 'Hello World!'?
- Allo World!
- BH
- Cllo
- DHello World!
6What is the output of len([1, 2, 3])?
- A1
- B2
- C3
- D4
7What is the output of print str * 2 if str = 'Hello World!'?
- AHello World!Hello World!
- BHello World! * 2
- Cerror
- D2
8Which of the following function convert an integer to a character in python?
- Aset(x)
- Bdict(d)
- Cfrozenset(s)
- Dchr(x)
9Which of the following function checks in a string that all characters are in lowercase?
- Aislower()
- Bisnumeric()
- Cisspace()
- Distitle()
10Which of the following function returns the max alphabetical character from the string str?
- Alower()
- Blstrip()
- Cmax(str)
- Dmin(str)
11Which of the following is correct about Python?
- AIt supports functional and structured programming methods as well as OOP.
- BIt can be used as a scripting language or can be compiled to byte-code for building large applications.
- CIt provides very high-level dynamic data types and supports dynamic type checking.
- DAll of the above
12What is the output of L[1:] if L = [1,2,3]?
- A2,3
- B2
- C3
- DNone of the above.
13What is the output of L[-2] if L = [1,2,3]?
- A1
- B2
- C3
- D-2
14What is the following function sorts a list?
- Alist.reverse()
- Blist.sort()
- Clist.pop(obj=list[-1])
- Dlist.remove(obj)
15State the output that would be produced from the following statement, when written in Python code: print “3”+”3”
- A33
- B3
- C6
- D333
16State the output that would be produced from the following statement, when written in Python code: print 3+3
- A33
- B3
- C6
- D333
17State the output that would be produced from the following statement, when written in Python code: print “3” * 3
- A33
- B3+3
- C6
- D333
18What is the output of print str[2:5] if str = 'Hello World!'?
- Allo World!
- BH
- Cllo
- DNone of the above.
19Which of the following function converts a string to all uppercase?
- Aupper()
- Bisdecimal()
- Cswapcase()
- Dtitle()
20Which of the following function converts a string to all lowercase?
- Aupper()
- Bisdecimal()
- Clower()
- Dtitle()
21Functions must be defined first ____________ they can be called
- ABefore
- BAfter
- CBetween
- DAt the same time
22What is the output of for x in [1, 2, 3]: print x?
- AX x x
- B1 2 3
- CError
- D1,2,3
23What is the output when following statement is executed print “a”+ “bc” ?
- AA
- Ba
- Cabc
- Dbc
24 What is the output when we execute print (list("hello"))?
- A[‘h’, ’e’, ’l’, ‘l’, ‘o’]
- B[‘hello’]
- C[‘llo’]
- D{‘hello’}
25What is the output from the following code str1="helloworld", str1[::-1]?
- Adlrowolleh
- Bhello
- Cworld
- Dhelloworld
26Suppose list1 is [2, 33, 222, 14, 25], What is list1[:-1]?
- A[2, 33, 222, 14]
- BError
- C25
- D[25, 14, 222, 33, 2]
27Which of the following is a Python tuple?
- A[1, 2, 3]
- B(1, 2 ,3)
- C{1, 2, 3}
- D{}
28Is Python case sensitive when dealing with identifiers?
- AYes
- BNo
29Which of the following cannot be a variable?
- A__init__
- Bin
- Cit
- Don
30Supports ‘Last in, first out’ ordering of data
- AQueue
- BStack
- CTuple
- DDictionary
31Which of the following is correct output of “print type(1/2)”?
- A<type 'int'>.
- B<type 'number'>
- C<type 'float'>
- D<type 'double'>
- E<type 'tuple'>
32Which of the following is correct output of “print type([1,2])”?
- A<type 'list'>
- B<type 'number'>
- C<type 'float'>
- D<type 'double'>
- E<type 'tuple'>
33Which of the following is correct output of “import math print(math.floor(5.6))”?
- A6
- B5.5
- C5.0
- D5
34Which of the following is correct output of “colors = [‘Red’, ‘Black’, ‘White’, ‘Green’] x = colors.index(“White”) print(x)”?
- A2
- B3
- C1
- D4
35Which of the following is correct output of “x = 12 y = 18 x = y y = x print(x,y)”?
- A12 18
- B18 18
- C12 12
- D18 12
36Which of the following is correct output of “x = ‘abcd’ y = 10 print(x+y)”?
- A10
- Babcd10
- Cabcd
- D10abcd
37Which of the following is correct output of “colors = [‘Red’, ‘Black’, ‘White’, ‘Green’] print(colors[-2][-2])”?
- An
- Ben
- Cc
- Dt
38Which of the following statement is Python comment?
- A*This is a Python comment
- B#This Is a Python comment
- Cnone of the above
- D//This is a Python comment
39Which of the following code will add a new color ‘Black’ at the end of the list?
- Acolors.insert('black')
- Bcolors.add('black')
- Ccolors.append('black')
- Dcolors+=('black')
40Which of the following expression is called for an user input?
- Ainput
- Bread
- Cnone of the above
- Dfor
41Which of the following is correct output of “colors = [‘red’, ‘white’, ‘Blue’, ‘green’] print(colors[-2])?
- A'white'
- B'blue'
- C'red'
- D'green'
42Which of the following is correct output of “print(type([1,2,3]))”?
- A<class 'list'>
- B<class 'tuple'>
- C<class 'set'>
- D<class 'type'>
43Which of the following is correct about Python?
- Apython is a high-level, interpreted, interactive and object-oriented scripting language
- Bpython is designed to be highly readable
- Cit uses English keywords frequently where as other languages use punctuation, and it has fewer syntactical constructions than other languages
- Dall Of The Above
44Is python a case sensitive language?
- ATrue
- BFalse
45Which of the following data types is not supported in python?
- Anumbers
- Bstring
- Clist
- Dslice
46Which of the following data types is not supported in python?
- Atuple
- Bdictionary
- Cgenerics
- Dlist
47What is the output of print str if str = 'Hello World!'?
- AHello World!
- Berror
- Cstr
- Dnone of the above
48What is the output of print str[0] if str = 'Hello World!'?
- AHello World!
- BH
- Cello World!
- Dstr
49What is the output of print str[2:5] if str = 'Hello World!'?
- AHello World!
- Bllo World!
- CH
- Dllo
50_________________ in Python are identified as a contiguous set of characters in between quotation marks
- Anumbers
- Bstrings
- Clist
- Dtuple
51What is the output of print list if list = [ 'abcd', 786, 2.23, 'john', 70.2]?
- A[ 'abcd', 786, 2.23, 'john', 70.2]
- Blist
- Cerror
- D[ 'abcd', 786, 2.23, 'john']
52What is the output of print list[0] if list = [ 'abcd', 786, 2.23, 'john', 70.2]?
- A[ 'abcd', 786, 2.23, 'john', 70.2]
- Blist
- Cerror
- D[ 'abcd']
53What is the output of print list[1:3] if list = [ 'abcd', 786, 2.23, 'john', 70.2]?
- A[ 'abcd', 786, 2.23, 'john', 70.2]
- Blist
- C[786, 2.23, 'john']
- D[ 'abcd']
54What is the output of print list[2:] if list = [ 'abcd', 786, 2.23, 'john', 70.2]?
- A[ 'abcd', 786, 2.23, 'john', 70.2]
- B[786, 2.23, 'john', 70.2]
- C[2.23, 'john', 70.2]
- D[ 'abcd']
55What is the output of print tinylist * 2 if tinylist = [123, 'john']?
- A[123, 'john', 123, 'john']
- B[123, 'john'] * 2
- CError
- D[123]
56Which of the following operator in python performs exponential (power) calculation on operands?
- A**
- B//
- Cis
- Dnot in
57Which of the following function changes case for all letters in string?
- Aswap(old, new [, max])
- Bstrip([chars])
- Cswapcase().
- Dtitle()
58What is the output of ['Hi!'] * 4?
- A['Hi!', 'Hi!', 'Hi!', 'Hi!']
- B['Hi!'] * 4
- CError
- Dnone of the above
59What is the following function sorts a list?
- Alist.reverse()
- Blist.sort([func])
- Clist.pop(obj=list[-1])
- Dlist.remove(obj)
60Following set of commands are executed in shell, what will be the output? >>>str="Hello" >>>str[:2]
- AHe
- Blo
- Colleh
- Dhello
61What kind of error occurs when you execute the following code apple = mango?
- ASyntaxerror
- BNameerror
- CValueerror
- DTypeerror
62Select all options that will correctly print “hello-how-are-you”?
- Aprint(‘hello’, ‘how’, ‘are’, ‘you’)
- Bprint(‘hello’, ‘how’, ‘are’, ‘you’ + ‘-‘ * 4)
- Cprint(‘hello-‘ + ‘how-are-you’)
- Dprint(‘hello’, ‘how’, ‘are’)
63What is the answer of this expression, 22 % 3?
- A7
- B1
- C0
- D5
64You can’t perform mathematical operation on String?
- ATrue
- BFalse
65Operators with the same precedence are evaluated in which manner?
- Aleft to right
- Bright to left
66How will you get ‘min’ alphabetical character from the string?
- Amin(str)
- Bmax(str)
- Cmin(int)
- Dlower()
67How will you get ‘max’ alphabetical character from the string?
- Amin(str)
- Bmax(str)
- Cmin(int)
- Dlower()
68How will you convert a string to all lowercase?
- Amin(str)
- Bmax(str)
- Cmin(int)
- Dlower()
69Which of the following is invalid?
- A_a = 1
- B__a = 1
- C__str__ = 1
- Da% = 1
70Which of the following is an invalid variable?
- Amy_string_1
- B1st_string
- Cfoo
- Dalua
71Why are local variable names beginning with an underscore discouraged?
- AThey Are Used To Indicate a Private Variables of a Class
- BThey confuse the interpreter
- CThey are used to indicate global variables
- DThey slow down execution
72Which of the following is not a keyword?
- Aeval
- Bassert
- Cnonlocal
- Dpass
73All keywords in Python are in
- Alower case
- Bupper case
- CCapitalized
- Dnone
74Which of the following is true for variable names in Python?
- AUnlimited length
- BAll private members must have leading and trailing underscores
- CUnderscore and ampersand are the only two special characters allowed
- Dnone
75Which of the following is an invalid statement?
- Aabc = 1,000,000
- Ba b c = 1000.2000.3000
- Ca,b,c = 1000, 2000, 3000
- Da_b_c = 1,000,000
76Which of the following cannot be a variable?
- A__init__
- Bin
- Cit
- Don
77What does the function re.match do?
- AMatches a Pattern at the Start of the String
- Bmatches a pattern at any position in the string
- Csuch a function does not exist
- Dnone of the mentioned
78Which of the following is incorrect?
- Afloat(‘inf’)
- Bfloat(‘nan’)
- Cfloat(’56’+’78’)
- Dfloat(’12+34′)
79Int(x) means variable x is converted to integer
- AVerdadero
- BFalso
80Can You perform mathematical operation with String?
- AYes
- BNo
- CNone
- DBoth
81Which of the following logical operator is correct for definition “If both the operands are true then then condition becomes true”
- AAnd
- BNo correct answer
- CNot
- DIn
82Which of the following logical operator is correct for definition “If both the operands are false then then condition becomes true”
- AAnd
- BNo correct answer
- CNot
- DOR
83Which of the following logical operator is correct for definition “If one of the operands is false, second is true then condition becomes false”
- AAnd
- BNo correct answer
- CIN
- DOR
84Which of the following logical operator is correct for definition “If one of the operands is false, second is true then condition becomes true”
- AAnd
- BNo correct answer
- CIN
- DOR
85Checks if the value of left operand is greater than the value of right operand, if yes then condition becomes true
- A>
- B<
- C>=
- D<=
86Checks if the value of left operand is less than the value of right operand, if yes then condition becomes true
- A>
- B<
- C>=
- D<=
87Checks if the value of left operand is greater than or equal to the value of right operand, if yes then condition becomes true
- A>
- B<
- C>=
- D<=
88Checks if the value of left operand is less than or equal to the value of right operand, if yes then condition becomes true
- A>
- B<
- C>=
- D<=
89Choose the correct expressing computations definition for “Get data from the keyboard, a file, or some other device”
- AInput
- BOutput
- CMaths
- DRepetition
90Choose the correct expressing computations definition for “Display data on the screen or send data to a file or other device”
- AInput
- BOutput
- CMaths
- DRepetition
91Choose the correct expressing computations definition for “Perform basic mathematical operations like addition and multiplication”
- AInput
- BOutput
- CMaths
- DRepetition
92Choose the correct expressing computations definition for “Check for certain conditions and execute the appropriate code”
- AInput
- BOutput
- CConditional logic
- DRepetition
93Choose the correct expressing computations definition for “Perform some action repeatedly, usually with some variation”
- AInput
- BOutput
- CMaths
- DRepetition
94Choose the correct definition for High level code
- ASyntax a specific type of computer can understand
- BAlso known as Assembly or Machine Code
- CRare to directly create now
- DHuman friendly syntax
95_________________is a name that refers to a value
- AVariable
- BName
- CValue
- DNothing
96_______________________is used to create variables and to give them values
- AAssignment statement
- BVariable
- CNaming
- DStatement
97We can use the ______________ function to check the type of a variable
- AType()
- BCheck()
- CVariable()
- DStr()
98We can alter the type of a variable using the following functions, which is “converts variable to a string”
- AType()
- BInt()
- CFloat()
- DStr()
99We can alter the type of a variable using the following functions, which is “converts variable to a integer”
- AType()
- BInt()
- CFloat()
- DStr()
100We can alter the type of a variable using the following functions, which is “converts variable to a float”
- AType()
- BInt()
- CFloat()
- DStr()
101Choose the keyword that cannot be used as names for variables as they already have a meaning and purpose.
- Adef
- Bdefinition
- Cpurpose
- Dprinting
102Lists are a commonly used, simple compound data type in Python, choose the correct answer for “index starts at 0”
- Amylist[0]
- Bmylist[-1]
- Cmylist[2:4]
- Dmylist[1]
103Lists are a commonly used, simple compound data type in Python, choose the correct answer for “reversing from the last value”
- Amylist[0]
- Bmylist[-1]
- Cmylist[2:4]
- Dmylist[1]
104Lists are a commonly used, simple compound data type in Python, choose the correct answer for “subset of the values”
- Amylist[0]
- Bmylist[-1]
- Cmylist[2:4]
- Dmylist[1]
105in python we use data type, that has keys with values called?
- ALists
- BDictionaries
- CDairies
- DCompounds
106There is dictionary called telnumbers = {‘john’: 756, ‘mike’: 789, ‘alex’: 456, ‘sue’: 123}, how to print everything from the dictionary?
- Aprint numbers
- Btelnumbers
- Ctelnumbers[‘alex’]
- Dtelnumbers.keys()
107There is dictionary called telnumbers = {‘john’: 756, ‘mike’: 789, ‘alex’: 456, ‘sue’: 123}, how to print dictionary keys?
- Aprint numbers
- Btelnumbers
- Ctelnumbers[‘alex’]
- Dtelnumbers.keys()
108There is dictionary called telnumbers = {‘john’: 756, ‘mike’: 789, ‘alex’: 456, ‘sue’: 123}, how to print Alex’s telephone number?
- Aprint numbers[‘alex’]
- Btelnumbers
- Ctelnumbers[‘alex’]
- Dtelnumbers.keys()
109There is dictionary called telnumbers = {‘john’: 756, ‘mike’: 789, ‘alex’: 456, ‘sue’: 123}, which of the following is the dictionary key?
- A‘john’
- B756
- C'alua’
- Dnumbers.keys
110There is dictionary called telnumbers = {‘john’: 756, ‘mike’: 789, ‘alex’: 456, ‘sue’: 123}, which of the following is the dictionary value?
- A‘john’
- B756
- C‘456’
- Dnumbers.keys
111choose the correct definition for ‘syntax error’
- AThe structure or tokens in the code are wrong
- BAn operation is applied to data of the wrong type
- CReferring to a variable that has not been assigned a value
- DNone of the mentioned
112choose the correct definition for ‘type error’
- AThe structure or tokens in the code are wrong
- BAn operation is applied to data of the wrong type
- CReferring to a variable that has not been assigned a value
- DNone of the mentioned
113choose the correct definition for ‘name error’
- AThe structure or tokens in the code are wrong
- BAn operation is applied to data of the wrong type
- CReferring to a variable that has not been assigned a value
- DNone of the mentioned
114Functions must be defined ___________ they can be called?
- AAfter
- BBefore
- CInstead
- DWith def keyword
115Which of the following is the use of function in python?
- AFunctions are reusable pieces of programs
- BFunctions don’t provide better modularity for your application
- Cyou can’t also create your own functions
- DAll of the mentioned
116Which keyword is use for function?
- AFun
- BDefine
- CDef
- DFunction
117What is the output of the below program ?

- AHello World! Hello World!
- B‘Hello World!’ ‘Hello World!’
- CHello Hello
- DNone of the mentioned
118What is the output of the below program ?

- A3
- B4
- C4 is maximum
- D3 is maximum
119What is the output of the below program ?

- Ax is 50 Changed global x to 2 Value of x is 50
- Bx is 50 Changed global x to 2 Value of x is 2
- Cx is 50 Changed global x to 50 Value of x is 50
- Dx is 50 Changed global x to 50 Value of x is 2
120Which are the advantages of functions in python?
- AReducing duplication of code
- BDecomposing complex problems into simpler pieces
- CImproving clarity of the code
- DAll of the mentioned
121What are the two types of functions?
- ACustom function and Built-in function
- BBuilt-in function and User-Defined function
- CCustom function and System function
- DSystem function and User-Defined function
122Where is function defined?
- AModule
- BClass
- CAnother function
- DAll of the mentioned
123What is the output of below program ?

- A3
- B9
- C27
- D333
124What is the output of below program ?

- A432
- B230400
- C24000
- D430
125What are the keys? for d = {"john":40, "peter":45}
- A“john”, 40, 45, and “peter”
- B“john” and “peter”
- C40 and 45
- Dd = (40:”john”, 45:”peter”)
126What will be the output ?

- ATrue
- BFalse
- CError
- DNone
127What will be the output ?

- ATrue
- BFalse
- CError
- DNone
128What will be the output

- ATrue
- BFalse
- CError
- DNone
129What is the output for code? >> d = {"john":40, "peter":45} >> d["john"]
- A40
- B45
- CJohn 40
- DPeter 45
130Suppose d = {“john”:40, “peter”:45}, what happens when retieving a value using d[“susan”]?
- ASince “susan” is not a value in the set, Python raises a KeyError exception.
- BIt is executed fine and no exception is raised, and it returns None.
- CSince “susan” is not a key in the set, Python raises a KeyError exception.
- DSince “susan” is not a key in the set, Python raises a syntax error.
131Choose the correct expressing computations definition for “Display data on the screen or send data to a file or other device”
- AInput
- BOutput
- CMaths
- DRepetition
132Choose the correct expressing computations definition for “Perform basic mathematical operations like addition and multiplication”
- AInput
- BOutput
- CMaths
- DRepetition
133Choose the correct expressing computations definition for “Check for certain conditions and execute the appropriate code”
- AInput
- BOutput
- CConditional logic
- DRepetition
134Choose the correct expressing computations definition for “Perform some action repeatedly, usually with some variation”
- AInput
- BOutput
- CMaths
- DRepetition
135Choose the correct definition for High level code
- ASyntax a specific type of computer can understand
- BAlso known as Assembly or Machine Code
- CRare to directly create now
- DHuman friendly syntax
136_________________is a name that refers to a value
- AVariable
- BName
- CValue
- DNothing
137_______________________is used to create variables and to give them values
- AAssignment statement
- BVariable
- CNaming
- DStatement
138We can use the ______________ function to check the type of a variable
- AType()
- BCheck()
- CVariable()
- DStr()
139We can alter the type of a variable using the following functions, which is “converts variable to a string”
- AType()
- BInt()
- CFloat()
- DStr()
140We can alter the type of a variable using the following functions, which is “converts variable to a integer”
- AType()
- BInt()
- CFloat()
- DStr()
141We can alter the type of a variable using the following functions, which is “converts variable to a float”
- AType()
- BInt()
- CFloat()
- DStr()
142Choose the keyword that cannot be used as names for variables as they already have a meaning and purpose.
- Adef
- Bdefinition
- Cpurpose
- Dprinting
143Lists are a commonly used, simple compound data type in Python, choose the correct answer for “index starts at 0”
- Amylist[0]
- Bmylist[-1]
- Cmylist[2:4]
- Dmylist[1]
144Lists are a commonly used, simple compound data type in Python, choose the correct answer for “reversing from the last value”
- Amylist[0]
- Bmylist[-1]
- Cmylist[2:4]
- Dmylist[1]
145Lists are a commonly used, simple compound data type in Python, choose the correct answer for “subset of the values”
- Amylist[0]
- Bmylist[-1]
- Cmylist[2:4]
- Dmylist[1]
146in python we use data type, that has keys with values called?
- ALists
- BDictionaries
- CDairies
- DCompounds
147There is dictionary called telnumbers = {‘john’: 756, ‘mike’: 789, ‘alex’: 456, ‘sue’: 123}, how to print everything from the dictionary?
- Aprint numbers
- Btelnumbers
- Ctelnumbers[‘alex’]
- Dtelnumbers.keys()
148There is dictionary called telnumbers = {‘john’: 756, ‘mike’: 789, ‘alex’: 456, ‘sue’: 123}, how to print dictionary keys?
- Aprint numbers
- Btelnumbers
- Ctelnumbers[‘alex’]
- Dtelnumbers.keys()
149There is dictionary called telnumbers = {‘john’: 756, ‘mike’: 789, ‘alex’: 456, ‘sue’: 123}, how to print Alex’s telephone number?
- Aprint numbers[‘alex’]
- Btelnumbers
- Ctelnumbers[‘alex’]
- Dtelnumbers.keys()
150There is dictionary called telnumbers = {‘john’: 756, ‘mike’: 789, ‘alex’: 456, ‘sue’: 123}, which of the following is the dictionary key?
- A‘john’
- B756
- C‘alua’
- Dnumbers.keys
151There is dictionary called telnumbers = {‘john’: 756, ‘mike’: 789, ‘alex’: 456, ‘sue’: 123}, which of the following is the dictionary value?
- A‘john’
- B756
- C‘456’
- Dnumbers.keys
152choose the correct definition for ‘syntax error’
- AThe structure or tokens in the code are wrong
- BAn operation is applied to data of the wrong type
- CReferring to a variable that has not been assigned a value
- DNone of the mentioned
153choose the correct definition for ‘type error’
- AThe structure or tokens in the code are wrong
- BAn operation is applied to data of the wrong type
- CReferring to a variable that has not been assigned a value
- DNone of the mentioned
154choose the correct definition for ‘name error’
- AThe structure or tokens in the code are wrong
- BAn operation is applied to data of the wrong type
- CReferring to a variable that has not been assigned a value
- DNone of the mentioned
155Functions must be defined ___________ they can be called?
- AAfter
- BBefore
- CInstead
- DWith def keyword
156Which of the following is the use of function in python?
- AFunctions are reusable pieces of programs
- BFunctions don’t provide better modularity for your application
- Cyou can’t also create your own functions
- DAll of the mentioned
157Which keyword is use for function?
- AFun
- BDefine
- CDef
- DFunction
158What is the output of the below program ?

- AHello World! Hello World!
- B‘Hello World!’ ‘Hello World!’
- CHello Hello
- DNone of the mentioned
159What is the output of the below program ?

- A3
- B4
- C4 is maximum
- D3 is maximum
160What is the output of the below program ?

- Ax is 50 Changed global x to 2 Value of x is 50
- Bx is 50 Changed global x to 2 Value of x is 2
- Cx is 50 Changed global x to 50 Value of x is 50
- Dx is 50 Changed global x to 50 Value of x is 2
161Which are the advantages of functions in python?
- AReducing duplication of code
- BDecomposing complex problems into simpler pieces
- CImproving clarity of the code
- DAll of the mentioned
162What are the two types of functions?
- ACustom function and Built-in function
- BBuilt-in function and User-Defined function
- CCustom function and System function
- DSystem function and User-Defined function
163Where is function defined?
- AModule
- BClass
- CAnother function
- DAll of the mentioned
164What is the output of below program ?

- A3
- B9
- C27
- D333
165What is the output of below program ?

- A432
- B230400
- C24000
- D430
166What are the keys? for d = {"john":40, "peter":45}
- A“john”, 40, 45, and “peter”
- B“john” and “peter”
- C40 and 45
- Dd = (40:”john”, 45:”peter”)
167What will be the output ?

- ATrue
- BFalse
- CError
- DNone
168What will be the output ?

- ATrue
- BFalse
- CError
- DNone
169What will be the output ?

- ATrue
- BFalse
- CError
- DNone
170What is the output for code? >> d = {"john":40, "peter":45} >> d["john"]
- A40
- B45
- CJohn 40
- DPeter 45
171Suppose d = {“john”:40, “peter”:45}, what happens when retieving a value using d[“susan”]?
- ASince “susan” is not a value in the set, Python raises a KeyError exception.
- BIt is executed fine and no exception is raised, and it returns None.
- CSince “susan” is not a key in the set, Python raises a KeyError exception.
- DSince “susan” is not a key in the set, Python raises a syntax error.
172What is the output of the below program ?

- Ax is 50 Changed global x to 2 Value of x is 50
- Bx is 50 Changed global x to 2 Value of x is 2
- Cx is 50 Changed global x to 50 Value of x is 50
- Dx is 50 Changed global x to 50 Value of x is 2
173Which are the advantages of functions in python?
- AReducing duplication of code
- BDecomposing complex problems into simpler pieces
- CImproving clarity of the code
- DAll of the mentioned
174What are the two types of functions?
- ACustom function and Built-in function
- BBuilt-in function and User-Defined function
- CCustom function and System function
- DSystem function and User-Defined function
175Where is function defined?
- AModule
- BClass
- CAnother function
- DAll of the mentioned
176What is the output of below program ?

- A3
- B9
- C27
- D333
177What is the output of below program ?

- A432
- B230400
- C24000
- D430
178What are the keys? for d = {"john":40, "peter":45}
- A“john”, 40, 45, and “peter”
- B“john” and “peter”
- C40 and 45
- Dd = (40:”john”, 45:”peter”)
179What will be the output ?

- ATrue
- BFalse
- CError
- DNone
180What will be the output ?

- ATrue
- BFalse
- CError
- DNone
Información
- Descripción
- Final questions
- Autor
- YouTube Channel
- Idioma
- English
- Visitas
- 123
- Valoración
- Aún sin valoraciones Valora este test