# Python/Python Mcq Set 1 Sample Test,Sample questions

1. int

2.bool

3.void

4.None

## Question: ` Is Python case sensitive when dealing with identifiers?`

1. yes

2.no

3.machine dependent

4.none of the mentioned

## Question: ``` Select all options that print. hello-how-are-you```

1.print(â€˜helloâ€™, â€˜howâ€™, â€˜areâ€™, â€˜youâ€™)

2.print(â€˜helloâ€™, â€˜howâ€™, â€˜areâ€™, â€˜youâ€™ + â€˜-â€˜ * 4)

3.print(â€˜hello-â€˜ + â€˜how-are-youâ€™)

4.print(â€˜helloâ€™ + â€˜-â€˜ + â€˜howâ€™ + â€˜-â€˜ + â€˜areâ€™ + â€˜youâ€™)

1. list

2.dictionary

3.array

4. tuple

## Question: ` What is the output of print 0.1 + 0.2 == 0.3?`

1.True

2. False

3.Machine dependent

4.Error

1.Boolean

2.Integer

3.Float

4.Complex

## Question: ` Which of the following is incorrect?`

1.float(â€˜infâ€™)

2.float(â€˜nanâ€™)

3. float(â€™56â€™+â€™78â€™)

4.float(â€™12+34â€²)

1. 0.0

2. 0

3. 1.0

4. 1

1. list

2. tuple

3.class

4.Dictionary

## Question: ```In python we do not specify types, it is directly interpreted by the compiler, so consider the following operation to be performed. >>>x = 13 ? 2 objective is to make sure x has a integer value, select all that apply (python 3.xx)```

1.x = 13 // 2

2. x = int(13 / 2)

3.x = 13 % 2

4.all of the mentioned

## Question: `Operators with the same precedence are evaluated in which manner?`

1. Left to Right

2.Right to Left

3.Canâ€™t say

4.none of the mentioned

1.64, 512, 64

2.64, 64, 64

3.512, 512, 512

4.512, 64, 512

1. 81

2.12

3. 0.75

4. 7

1. -5

2.-4

3.-3

4.+3

1. +5

2.-11

3.+11

4. -5

1.SyntaxError

2.NameError

3. ValueError

4. TypeError

1.7

2. 1

3. 0

4.5

## Question: `What is the maximum possible length of an identifier?`

1.31 characters

2.63 characters

3.79 characters

4.none of the mentioned

1. 27

2.9

3.3

4. 1

1. 1

2.0

3.True

4.False

## Question: `What is the result of round(0.5) â€“ round(-0.5)?`

1.1.0

2.2.0

3. 0.0

4.Value depends on Python version

1.int

2.float

3.bool

4. dict

1.int

2.bool

3.float

4.None

1. (6.0, 16.0)

2. (6.00, 16.00)

3.(6, 16)

4.(6.00, 16.0)

1. (1.0, 4.0)

2.(1.0, 1.0)

3.(4.0. 1.0)

4.(4.0, 4.0)

1.8

2.8.0

3.8.3

4.8.33

1. (1,3)

2. (0,3)

3.(1,0)

4.(3,1)

1. Error

2.1.0

3.1.00

4.1

1. 4

2.7

3.2

4.0

1.3

2.7

3. 77

4.0

1. 5.0

2.5

3.4.0

4.4

1.30.0

2. 30.8

3.28.4

4.27.2

1.43

2. 44

3. 22

4.23

1. <<, >>

2.**

3.|

4.%

## Question: `Which is the correct operator for power(xy)?`

1.X^y

2.X**y

3. X^^y

4.none of the mentioned

1.4.7 â€“ 1.5

2.7.9 * 6.3

3.1.7 % 2

4.3.4 + 4.6

## Question: `Which of the following expressions is an example of type conversion?`

1. 4.0 + float(3)

2. 5.3 + 6.3

3.5.0 + 3

4. 3 + 7

## Question: `Which of the following expressions results in an error?`

1.float(â€˜10â€™)

2.int(â€˜10â€™)

3.float(â€™10.8â€™)

4. int(â€™10.8â€™)

1.my_string_1

2.1st_string

3.foo

4. _

1. x = 0b101

2. x = 0x4f5

3. x = 19023

4.x = 03964

## Question: `Which of the following is invalid?`

1. _a = 1

2. __a = 1

3.__str__ = 1

4.none of the mentioned

## Question: `Which of the following is not a complex number?`

1.k = 2 + 3j

2. k = complex(2, 3)

3.k = 2 + 3l

4.k = 2 + 3J

1. eval

2.assert

3.nonlocal

4. pass

1. /

2.%

3. //

4. |

1. +

2. //

3.%

4.**

## Question: `Which of the following results in a SyntaxError?`

1. â€˜â€Once upon a timeâ€¦â€, she said.â€™

2.â€œHe said, â€˜Yes!'â€

3. â€˜3â€™

4. â€â€™Thatâ€™s okayâ€â€™

## Question: `Which of the following will run without errors?`

1.round(45.8)

2.round(6352.898,2,5)

3.round()

4. round(7463.123,2,1)

1. Lists

2. Dictionary

3. Tuples

4. Class

## Question: `Which one of these is floor division?`

1. /

2. //

3.%

4.none of the mentioned

## Question: `Why are local variable names beginning with an underscore discouraged?`

1. they are used to indicate a private variables of a class

2. they confuse the interpreter

3.they are used to indicate global variables

4. they slow down execution

## More MCQS

##### Olete Team
Online Exam TestTop Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on Online Exam Testwebsite 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!