Introduction to Python Programming
University of Pennsylvania
Homework 3: Instructions
Homework 3: Implement Functions Related to Strings, Lists, Sets, & Tuples
This assignment is designed to give you practice writing code and applying lessons and topics for the current module.
This homework deals with the following topics:
Strings
Lists
Sets
Tuples
The Assignment
In this assignment, you will implement some functions related to strings, lists, sets and tuples. Each function has been defined for you, but without the code. See the docstring in each function for instructions on what the function is supposed to do and how to write the code. It should be clear enough. In some cases, we have provided hints to help you get started.
For example, we have defined a “concatenate” function for you (see below) which concatenates a given list of strings into a single string and returns it. Read the docstring, which explains what the function is supposed to do. Then write your code where it says “# TODO” to implement the function. You’ll do this for each function in the program.
We’ll run a Python test script against your program to test whether each function implementation is correct and whether you have considered enough cases. Examples of cases have been provided in the docstrings.
The main function has been completely implemented for you (see example snippet below). Use it to run and interact with your program, and to see if your functions are working as expected. Spend some time on testing.
0 Comments
If you have any doubts/suggestion/any query or want to improve this article, you can comment down below and let me know. Will reply to you soon.