Quiz Discussion

What is the average value of the following Python code snippet?

>>>grade1 = 80
>>>grade2 = 90
>>>average = (grade1 + grade2) / 2

 

Course Name: Python

  • 1]

    85.0

  • 2]

    85.1

  • 3]

    95.0

  • 4]

    95.1

Solution
No Solution Present Yet

Top 5 Similar Quiz - Based On AI&ML

Quiz Recommendation System API Link - https://fresherbell-quiz-api.herokuapp.com/fresherbell_quiz_api

# Quiz
1
Discuss

Which of the following is the truncation division operator?

  • 1]

    /

  • 2]

    %

  • 3]

    //

  • 4]

    |

Solution
2
Discuss

Given a function that does not return any value, What value is thrown by default when executed in shell.

  • 1]

    int

  • 2]

    bool

  • 3]

    void

  • 4]

    None

Solution
3
Discuss

What data type is the object below?

L = [1, 23, 'hello', 1]

 

  • 1]

    list

  • 2]

    dictionary

  • 3]

    array

  • 4]

    tuple

Solution
4
Discuss

What will be the output of the following Python code?

>>>str="hello"
>>>str[:2]
>>>

 

  • 1]

    he

  • 2]

    olleh

  • 3]

    lo

  • 4]

    hello

Solution
5
Discuss

Which one of the following has the same precedence level?

  • 1]

    Addition and Subtraction

  • 2]

    Multiplication, Division and Addition

  • 3]

    Multiplication, Division, Addition and Subtraction

  • 4]

    Addition and Multiplication

Solution
6
Discuss

The value of the expressions 4/(3*(2-1)) and 4/3*(2-1) is the same.

  • 1]

    True

  • 2]

    False

Solution
7
Discuss

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”’

Solution
8
Discuss

What is the order of precedence in python?

i) Parentheses
ii) Exponential
iii) Multiplication
iv) Division
v) Addition
vi) Subtraction

  • 1]

    i,ii,iii,iv,v,vi

  • 2]

    ii,i,iii,iv,v,vi

  • 3]

    ii,i,iv,iii,v,vi

  • 4]

    i,ii,iii,iv,vi,v

Solution
9
Discuss

What will be the value of x in the following Python expression?

x = int(43.55+2/2)

 

  • 1]

    43

  • 2]

    44

  • 3]

    22

  • 4]

    23

Solution
10
Discuss

What are the values of the following Python expressions?

 2**(3**2)
 (2**3)**2
 2**3**2

 

  • 1]

    64, 512, 64

  • 2]

    512, 512, 512

  • 3]

    512, 64, 512

  • 4]

    64, 64, 64

Solution
# Quiz