# Test Your Python Skills! Hardest Trivia Questions Quiz

35 Questions | Total Attempts: 119  Settings  • 1.
Which is the correct operator for power(x^y)?
• A.

X^y

• B.

X**y

• C.

X^^y

• D.

None of the mentioned

• 2.
Which one of these is floor division?
• A.

/

• B.

//

• C.

%

• D.

None of the mentioned

• 3.
What is answer of this expression, 22 % 3 is?
• A.

7

• B.

1

• C.

0

• D.

5

• 4.
You can perform mathematical operation on String?
• A.

True

• B.

False

• 5.
Operators with the same precedence are evaluated in which manner?
• A.

Left to Right

• B.

Right to Left

• 6.
What is the output of this expression, 3*1**3?
• A.

27

• B.

9

• C.

3

• D.

1

• 7.
Which one of the following have the same precedence?
• A.

• B.

Multiplication and Division

• C.

Both the options

• D.

None of the options

• 8.
Int(x) means variable x is converted to integer.
• A.

True

• B.

False

• 9.
Which one of the following have the highest precedence in the expression?
• A.

Exponential

• B.

• C.

Multiplication

• D.

Parentheses

• 10.
What is returned by math.ceil(3.4)?
• A.

3

• B.

4

• 11.
What is the value returned by math.floor(3.4)?
• A.

3

• B.

4

• 12.
What is the value returned by math.fact(6)?
• A.

720

• B.

6

• C.

[6,5,4,3,2,1]

• D.

Error

• 13.
Which of the following statement prints hello\example\test.txt ?
• A.

Print(“hello\example\test.txt”)

• B.

Print(“hello\\example\\test.txt”)

• C.

Print(“hello\”example\”test.txt”)

• D.

Print(“hello”\example”\test.txt”)

• 14.
Suppose s is “\t\tWorld\n”, what is s.strip() ?
• A.

\t\tWorld\n

• B.

\tWorld\n

• C.

\t\tWORLD\n

• D.

World

• 15.
What is the output of “hello”+1+2+3 ?
• A.

Hello123

• B.

Hello

• C.

Error

• D.

Hello6

• 16.
Say s=”hello” what will be the return value of type(s) ?
• A.

Int

• B.

Bool

• C.

Str

• D.

String

• 17.
Python is case sensitive when dealing with identifiers?
• A.

True

• B.

False

• 18.
What is the maximum possible length of an identifier?
• A.

31 characters

• B.

310 characters

• C.

255 characters

• D.

None of the mentioned

• 19.
Which of the following is invalid?
• A.

_a=1

• B.

__a = 1

• C.

A_a = 1

• D.

1 = _a

• 20.
Which of the following is an invalid variable?
• A.

My_string_1

• B.

1st_string

• C.

Foo

• D.

_a

• 21.
Which of the following cannot be a variable?
• A.

__init__

• B.

In

• C.

It

• D.

On

• 22.
Which of the following is the use of function in python?
• A.

Functions are reusable pieces of programs

• B.

Functions don’t provide better modularity for your application

• C.

You can’t also create your own functions

• D.

All of the mentioned

• 23.
Which keyword is use for function?
• A.

Fun

• B.

Def

• C.

Function

• D.

Define

• 24.
Which of these in not a core datatype?
• A.

Lists

• B.

Dictionary

• C.

Tuples

• D.

Class

• 25.
What is the return type of function id ?
• A.

Int

• B.

Float

• C.

Dict

• D.

List

Related Topics Back to top