Python Quiz -6 Summer internship

Python Quiz -6 Summer internship

University

10 Qs

quiz-placeholder

Similar activities

Brainy Bites: Python

Brainy Bites: Python

University

12 Qs

Hash Tables Quiz

Hash Tables Quiz

University

15 Qs

Python Review Module 14 - Recursion

Python Review Module 14 - Recursion

University

10 Qs

Day - 4

Day - 4

University

15 Qs

ATP-lab viva

ATP-lab viva

University

10 Qs

Lecture 1_Introduction of MyCESMM2

Lecture 1_Introduction of MyCESMM2

University

8 Qs

Կայքերի ստեղծում - Դաս 4

Կայքերի ստեղծում - Դաս 4

4th Grade - University

10 Qs

POST-TEST MODULE 4

POST-TEST MODULE 4

University

15 Qs

Python Quiz -6 Summer internship

Python Quiz -6 Summer internship

Assessment

Quiz

Other

University

Easy

Created by

Gnaneshwar Reddy

Used 1+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

  1. Which of the following statements correctly defines a function in Python?

  • a) function myFunction()

  • b) def myFunction:

  • c) def myFunction():

  • d) define myFunction()

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

  1. What is the output of the following code?

    def add(a, b):

    1. return a + b print(add(2, 3))

  • a) 2

  • b) 3

  • c) 5

  • d) None

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

  1. How do you call a function named myFunction in Python?

  • a) call myFunction

  • b) myFunction()

  • c) execute myFunction

  • d) myFunction

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

    • Which of the following lists is a valid Python list?

  • a) (1, 2, 3)

  • b) {1, 2, 3}

  • c) [1, 2, 3]

  • d) 1, 2, 3

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

  1. What will be the output of the following code?

    my_list = [1, 2, 3, 4]

    print(my_list[2])

  • a) 1

  • b) 2

  • c) 3

  • d) 4

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

  1. How do you append an item to a list in Python?

  • a) list.add(item)

  • b) list.append(item)

  • c) list.insert(item)

  • d) list.appendList(item)

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

  1. What will be the output of the following code?

    def multiply_list(lst):

  2. result = 1

    1. for num in lst:

  3. result *= num

  4. return result

  5. my_list = [1, 2, 3, 4]

    1. print(multiply_list(my_list))

  • a) 10

  • b) 24

  • c) 12

  • d) None

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?