Functions and String Manipulation

Functions and String Manipulation

University

14 Qs

quiz-placeholder

Similar activities

PSP Week3

PSP Week3

University

10 Qs

Python introduction

Python introduction

University

15 Qs

Exploring Python: Input and Output Essentials

Exploring Python: Input and Output Essentials

9th Grade - University

10 Qs

python quiz

python quiz

6th Grade - Professional Development

10 Qs

Quiz 1

Quiz 1

University

10 Qs

KODEKIDDO HACK #MLH3

KODEKIDDO HACK #MLH3

4th Grade - University

10 Qs

Python Basics

Python Basics

University

10 Qs

Python

Python

7th Grade - Professional Development

13 Qs

Functions and String Manipulation

Functions and String Manipulation

Assessment

Quiz

Computers

University

Hard

Created by

Shashwat Rai

FREE Resource

14 questions

Show all answers

1.

MULTIPLE SELECT QUESTION

30 sec • 1 pt

What are some common built-in functions in Python?

input()

int()

len()

print()

str()

2.

MULTIPLE SELECT QUESTION

30 sec • 1 pt

What is the purpose of a function in programming?

To define reusable pieces of code

To take input and return output

To run automatically without being called

To create variables

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will the following code print? print(add_two(2,3))

2

3

5

None

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the keyword 'def' signify in Python?

It defines a function

It defines a variable

It defines a class

It defines a loop

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What happens if no return statement is given in a function?

The function will return None

The function will return 0

The function will return an error

The function will return an empty string

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the difference between local and global variables?

Local variables are accessible outside the function

Global variables are defined inside a function

Local variables are defined inside a function

Global variables can only be used inside the function

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will the following code print? print(len(s)) where s = 'Hello'

4

5

6

Hello

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?