

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Module 2 Python worksheet exercises
Typology: Exercises
1 / 2
This page cannot be seen from the preview
Don't miss anything!


1 - Name 4 built-in data types: ____________ ____________ ____________ ____________ 2 – In each example, we create a variable x. What is the data type of our variable x?
3 - Name 6 built-in functions: 4 - What data type must we always pass to the input() function? _________________________ 5 - What data type does the input() function always return? ___________________________ 6 - What are the two reserve words for bool? _________________ _________________ 7 – True or False: Python is an interpreted language. 8 – True or False: Python is case-sensitive. 9 – True or False: Variable names can have spaces. 10 – True or False: The proper style for variable names in Python is camelCase. 11 – True or False: For variable names, underscores can be used. 12 – True or False: For variable names, lower case is frequently used. 13 – True or False: This is a proper variable name: value 14 – True or False: This is a proper variable name: 1value 15 – True or False: Data types must be stated when declaring variables. 16 – True or False: We can use single quotes or double quotes for strings. 17 – True or False: It is possible to change the data type of a variable. 18 - Given the following code, list the following:
variable(s): ______________ literal(s): ___________________________________________ function(s) called: _____________________________________________________ data types used: ______________________________________________
19 - Given the following code, list the following:
variable(s): _____________________________________________________ literal(s): _____________________________________________________ function(s) called: _________________________________________________ argument(s): _____________________________________________________ data types used: ______________________________________________ 20 – All code below works, but there are style rules not followed. Rewrite the statements:
21 – Describe the steps (in order) that are performed for this line of code: