
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
13 questions
Computer Science: CPU performance
Quiz
•
University
12 questions
CIS1103 Week 9_10 CLO3 Part 1
Quiz
•
University
18 questions
Quiz on Misinformation and Bias
Quiz
•
10th Grade - University
11 questions
What is a computer
Quiz
•
KG - University
16 questions
Algo Quiz
Quiz
•
University
10 questions
Server Administration- Quiz 1
Quiz
•
12th Grade - University
11 questions
Computer Science (1-9) - Identifying & Preventing Threats
Quiz
•
University
14 questions
Semi-Long Quiz#1 - SAM, NW3A-3E
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
