Python Quiz -6 Summer internship

Python Quiz -6 Summer internship

University

10 Qs

quiz-placeholder

Similar activities

Pertemuan 4

Pertemuan 4

University

11 Qs

2R C-Skill Lab Test Autumn 2024-25

2R C-Skill Lab Test Autumn 2024-25

University

14 Qs

Python Numpy and Pandas Quiz

Python Numpy and Pandas Quiz

University

15 Qs

Stack Data Structure

Stack Data Structure

University

10 Qs

Aula Invertida

Aula Invertida

University

12 Qs

Object Oriented Programming

Object Oriented Programming

University

15 Qs

Week 4 Review

Week 4 Review

University

15 Qs

Pertemuan 5

Pertemuan 5

University

10 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?