Python/MCQ Introduction to Python Section 3 Sample Test,Sample questions

Question:
 print(“I” + “am” + “in” + “school”) display ___

1.I am in school

2.I Am In School

3.Iaminschool

4.iaminschool


Question:
 Which of the following statement is correct syntactically ?

1.print(“Hello” , sep == ‘@’ , end = ‘ ‘)

2.print(“Hello” , sep = ‘@’ , end = ‘ ‘)

3.Print(“Hello” , sep = ‘@’ , end = ‘ ‘)

4.print(“Hello” , sep = ‘@’ , end = ‘ ‘


Question:
>>> 14 + 2 ** 2 evaluates to 

1.256

2.18

3.28

4.32


Question:
>>> 15.0 / 4 + (8 + 3.0) evaluates to ________________

1.14.75

2.14

3.15

4.None of the above


Question:
>>> 15.0 / 4 + (8 + 3.0) evaluates to ________________

1.14.75

2.14

3.15

4.None of the above


Question:
>>> 15.0 / 4 + (8 + 3.0) evaluates to ________________

1.14.75

2.14

3.15

4.None of the above


Question:
>>> 15.0 / 4 + (8 + 3.0) evaluates to ________________

1.14.75

2.14

3.15

4.None of the above


Question:
>>> 15.0 / 4 + (8 + 3.0) evaluates to ________________

1.14.75

2.14

3.15

4.None of the above


Question:
>>> bool(0) evaluates to __

1.False

2.True

3.Error

4.None of the above


Question:
Aman wants to find the average of two numbers 10 and 12 and he write the code as 10 + 12/2, it would run successfully but the output is not correct. What type of error is done by Aman?

1.Syntax error

2.Logical error

3.Runtime error

4.None of the above


Question:
Binary operators are operators with ________ operands

1. 1

2.2

3.3

4.4


Question:
Errors in program is also called ____

1.virus

2.bug

3.beetle

4.val


Question:
Fill in the blank in given code :
print("The total in Rs." + __________(70))

1.int

2.float

3.str

4.bool


Question:
IDLE stands for __________

1. Integrated Development LEarning

2.Integrated Development Learning Environment

3.Intelligent Development Learning Environment

4.None of the above


Question:
IDLE stands for __________

1. Integrated Development LEarning

2.Integrated Development Learning Environment

3.Intelligent Development Learning Environment

4.None of the above


Question:
In given code _____________ conversion takes place.
num1 = 100 
num2 = 2.0 
sum1 = num1 + num2 
print(sum1)

1.implicit

2.explicit

3.hybrid

4.None of the above


Question:
In Python, we have ____________________ function for taking input from the user.

1.input( )

2.accept( )

3.c. enter( )

4.insert( )


Question:
In the given code, an integer value stored in variable num1 is added to a float value stored in variable num2, and the result is stored in variable sum1. This is an example of _____
sum1 = num1 + num2

1.implicit conversion

2.explicit conversion

3.data conversion

4.value conversion


Question:
int(123.45) is an example of _

1.explicit conversion

2.implicit conversion

3.quick conversion

4.None of the above


Question:
print(“I” , “am” , “in” , “school”) display __

1.I am in school

2.I Am In School

3.Iaminschool

4.iaminschool


Question:
Python uses _________________ function to output data to standard output device.

1.print( )

2.display( )

3.output( )

4.None of the above


Question:
Ravi is writing a program of printing “Hello World” but he forgot to close the bracket of print( ) function (as shown below). What type of error is this?
print("Hello World"

1.Syntax error

2.Logical error

3.Runtime error

4.None of the above


Question:
The process of removing errors from programs is called _________

1.Programming

2.Documentation

3.Debugging

4.None of the above


Question:
The user may enter a number or a string but the input() function treats them as _

1.integer only

2.list

3.strings only

4.tuple


Question:
What type of error is returned by following statement?
>>> age = input("Enter your age: ")
Enter your age: 3
>>> age + 3

1.SyntaxError

2.IndexError

3.ValueError

4.TypeError


Question:
Which of the following error may encounter in program of python?

1.Syntax error

2.Logical error

3.Runtime error

4.All the above


Question:
Which of the following function convert the data type of variable ‘x’ from float to integer?

1.float( )

2.int( )

3.str( )

4.num( )


Question:
Which of the following is explicit type conversion function in Python?

1.int( )

2.str( )

3. float( )

4.All the above


Question:
Which of the following is invalid expression?

1.250

2. 32 / 4 + 7

3.“Global” + “Citizen”

4.in


Question:
Which of the following is mutable data type?

1.string

2.Tuple

3.List

4.All the above


Question:
Which of the following is parameter of print( ) function?

1.sep

2.end

3.Both of the above

4.None of the above


Question:
Which of the following is valid membership operator?

1.in

2.not in

3.Both of the above

4.None of the above


Question:
Which of the following statement is correct to initialize multiple variables?

1.a = b = c = 85

2.a = b and c = 85

3.a = 85 , c = 85 , b =85

4.All the above


Question:
Which of the following statement return run time error ?

1.Divide any number by zero

2.Adding any number to zero

3.Subtracting any number from zero

4.Multiply any number with zero


Question:
Which operators can be used to determine whether two variables are referring to the same object or not.

1.Relational

2.Logical

3.Identity

4.Membership


Question:
Write the output of following code:
>>> n1 = 5
>>> n2 = n1
>>> n2 is n1

1.True

2.False

3.Error

4.5


Question:
Write the output of the following :
>>> age = input("Enter your age: ")
>>> type(age)

1.<class ‘int’>

2.<class ‘str’>

3.<class ‘list’>

4.None of the above


Question:
Write the output of the following :
>>> age = input("Enter your age: ")
Enter your age: 3
>>> age * 3

1.9

2.333

3.33

4.Error


Question:
Write the output of the following :
22 + (7 -2 // 9 ** 2)
a. 22

b. 7

c. 29

d. 0

1.22

2.7

3.29

4.0


Question:
Write the output of the following :
num1 = 100 
num2 = 2.0 
sum1 = num1 + num2 
print(sum1)

1.102

2.102.0

3.Error

4.None of the above


Question:
Write the output of the following :
print(3 and (5 or 0))

1.3

2.5

3.True

4.False


Question:
Write the output of the following :
print(True and (False or True))

1.True

2.False

3.Error

4.None of the above


Question:
Write the output of the following :
print(true and False)

1.True

2.False

3.Error

4.None of the above


Question:
Write the output of the following code :
print((15 // 2 ** 2) * 'A')

1.3

2.Error

3.AAA’

4.4


Question:
___ error causes abnormal termination of program while it is executing.

1.Syntax error

2.Logical error

3.Runtime error

4.None of the above


Question:
___ produces an undesired output but without termination of the program.
a. Syntax error

b. Logical error

c. 

1. Syntax error

2.Logical error

3.Runtime error

4.None of the above


Question:
____ operators are used to check if a value is a member of the given sequence or not.

1.Logical

2.Identity

3.Membership

4.Relational


Question:
________ happens when data type conversion is done automatically by Python.

1.Implicit conversion

2.Explicit conversion

3.Both of the above

4.None of the above


Question:
_________ is defined as a combination of constants, variables, and operators.

1.Statement

2.Expression

3.Operation

4.None of the above


More MCQS

  1. Python MCQS - Function
  2. Python MCQS - GUI in python
  3. Python MCQS - Operators
  4. Python MCQS - Data type in python
  5. Python MCQS - loops in python
  6. Python MCQS - Numpy
  7. Python MCQS - sqlite3
  8. Python MCQS - Library
  9. Python MCQS - Pandas
  10. Python MCQs
  11. Dictionary Python MCQ set 1
  12. Dictionary Python MCQ set 2
  13. MCQ For Python Fundamentals
  14. MCQ Introduction to Python Section 1
  15. MCQ Introduction to Python Section 2
  16. MCQ Introduction to Python Section 3
  17. MCQ on Flow of Control in Python Set 1
  18. MCQ on Flow of Control in Python Set 2
  19. MCQ on Python String Set 1
  20. File Handling in Python section 1
  21. File Handling in Python section 2
  22. Python Functions MCQS Set 1
  23. Python Functions MCQS Set 2
  24. MCQ on List in Python
  25. Pandas MCQ Questions Set 1
  26. Pandas MCQ Questions Set 2
  27. Tuple MCQ in Python
  28. Python dataframe MCQ
  29. Python Mcq Set 1
  30. Python Mcq Set 2
  31. Python Mcq Set 3
  32. Python Mcq Set 4
  33. Python Mcq Set 5
  34. Python Mcq Set 6
  35. Python Mcq Set 7
  36. Python Mcq Set 8
  37. Python Mcq Set 9
  38. Python Mcq Set 10
  39. Python Mcq Set 11
  40. Python Mcq Set 12
  41. Python Mcq Set 13
  42. Python Mcq Set 14
  43. Python Mcq Set 15
  44. Python Mcq Set 16
  45. Python Mcq Set 17
  46. Python Mcq Set 18
  47. Python Mcq Set 19
  48. Python Mcq Set 20
  49. Python Mcq Set 21
  50. Python MCQ
Search
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!