Which of the following is not a token?
1.//
2.“Xâ€
3.##
4.23
Write the output of the following code : >>> s = None >>> s
1.Nothing will be printed
2.None
3.Shows Error
4.None of the above
An escape sequence is represented by __________ slash followed by one or two characters.
1.back
2.forward
3.double
4.None of the above
Each statement in python is terminated by ___
1.Semicolon(;)
2.Colon(:)
3.Comma(,)
4.None of the above
Identifier name can be of maximum ____________ character
1.63
2.79
3.53
4.any number of
Identify the invalid identifier. b. c. d.
1.Keyword
2.token
3.operator
4.and
Operators of same precedence are executed from _____
1.left to right
2.right to left .
3.in any order
4.None of the above
Output of print(7 % 21) is ____
1.3
2.7
3.Error
4.None of the above
Smallest element of of python coding is called ________
1.Identifiers
2.Token
3.Keywords
4.Delimiters
Statement below “function definition†begin with spaces called ____
1.Indentation
2.Condition
3.Definition
4.None of the above
What type of error is returned by the following statement? def abc(a): print(a)
1.ErrorIndentation
2.IndentationError
3.SpaceError
4.No error in the given statement
What type of error is returned by the following statement? print(eval(13))
1.SyntaxError
2.TypeError
3.ValueError
4.No Error in this statement
What will be the data type of the following variable?
1.= ‘101’
2.Integer
3.String
4.Float
Which keyboard key is used to run python programs?
1.F6
2.F5
3. F + n
4.Ctrl + r
Which keyword is used to define a function in python?
1.def
2.define
3.new
4.None of the above
Which method is used to find the memory location of variable?
1.id( )
2.add( )
3.type( )
4.None of the above
Which of the following assignment will return error?
1.a = b = c = 89
2.a = 6, b = 8
3. a, b, c = 1, 2, 3
4.None of the above
Which of the following can not be used as an identifier?
1.eval
2.max
3.pass
4.All the above
Which of the following is invalid identifier?
1._
2._1st
3.1stName
4.While
Which of the following is invalid variable name? a.
1.Sum1
2. Num_1
3. Num1
4. N1
Which of the following is not correct about python?
1.Python is an open source language.
2.Python is based on ABC language.
3.Python is developed by Guido Van Rossum
4.None of the above
Which of the following is not correct about python?
1.Python is an open source language.
2.Python is based on ABC language.
3.Python is developed by Guido Van Rossum
4.None of the above
Which of the following is not in Python Character Set.
1.Letters : A-Z or a – z
2.Digits : 0 – 9
3.Whitespaces : blank space, tab etc
4.Images : Vector
Which of the following is not the mode of interacting with python?
1.Interactive Mode
2.Script Mode
3.Hybrid Mode
4.None of the above
Which of the following is valid operator?
1.in
2.on
3.it
4.at
Which of the following is wrong in reference to naming of variable?
1.Keywords are not allowed for variable names.
2.Spaces are not allowed for variable names.
3.ariable names can start from number.
4.Special symbols are not allowed
Which of the following statement is calculating x raise to power n?
1.x * n
2.x ** n
3.n ** x
4.x ^ n
Which of the following symbol is used to write comment?
1.?
2.//
3.#
4.**
Which statement is adding remainder of 8 divided by 3 to the product of 5 and 6?
1.8 % 3 + 5 * 6
2.8/3 + 5 * 6
3.8 // 3 + 6.5
4.None of the above
Which statement will display square of number (n)
1.print(n * n)
2. print(math.pow(n,2)) # math module is already imported
3.All of the above
4.Only First
Write the output of the following code : >>> 7+2//1**2 > 5+2**2//3 a. b.
1.True
2.False
3.Error
4.None of the above
Write the output of the following code : >>> a=9 >>> x=str(a) >>> b=5 >>> y=str(b) >>> x+y
1.14
2.9.5
3.9
4.None of the above
Write the output of the following code : >>> x = 4 - 7j >>> print(x.imag, x.real)
1.4.0 -7.0
2.-7.0 4.0
3.Error
4.None of the above
Write the output of the following code : x=2 y=3 x+y+5 print(x+y)
1.10
2.5
3.Error
4.None of the above
Write the output of the following code: x=2 x=5 x=x+x print(x)
1.7
2.4
3.10
4.error
Write the output of the following. def abc(): print("abc")
1. abc
2.Error
3.0
4. No Output
Write the output of the following. m, n, p = 1, 2, 3 print(m, n, p)
1.1, 2, 3
2.1 2 3
3.Print 1, 2 and 3 vertically
4.Error
Write the output of the following: a=8 def abc(a): print(a) abc(7)
1.8
2.Error
3.No Output
4.7
Write the output of the following: print(‘Hello, world!’);print(“Hâ€)
1.Hello world H
2.Hello worldH
3.Hello world H
4.error
Write the output of the following: print(range(0,8,2))
1.0,2,4,6
2.range(0, 8, 2)
3.Error
4.None of the above
___ spaces should be left for indentation.
1.3
2.4
3.5
4.0
____________ escape sequence is used for horizontal tab. a. b. c. T d. No
1./n
2./t
3.T
4.No
________________ method is used to find the data type of a variable.
1. type( )
2.dtype( )
3. typed( )
4.None of the above