
Functions and String Manipulation
Quiz
•
Computers
•
University
•
Practice Problem
•
Hard
Shashwat Rai
FREE Resource
Enhance your content in a minute
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
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
19 questions
DSA Quest 1.0
Quiz
•
University
10 questions
CHAPTER 1: COMPUTER SECURITY REVIEW
Quiz
•
University
10 questions
6-文件操作
Quiz
•
University
10 questions
Listen in Python
Quiz
•
University
13 questions
Chap 1: What is a program made of?
Quiz
•
University
10 questions
Introduction to AI - Healthcare & Business
Quiz
•
University - Professi...
10 questions
Komdat Chap 2
Quiz
•
University
10 questions
POP QUIZ 4 (DFC40243)
Quiz
•
University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
54 questions
Analyzing Line Graphs & Tables
Quiz
•
4th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
