Changes

Jump to: navigation, search

OPS435 Python Lab 4

2 bytes removed, 08:42, 9 September 2017
LAB REVIEW
# What is the purpose of a '''set'''? How do sets differ from lists or tuples?
# How do you define elements within a set?
# Assuming you have defined two sets called '''set1''' and '''set2'''. Write Python code to:<ol valuetype="a"><li>Return a set containing all values of both sets</li><li>Returns a set containing all values in set1 that are not found in set2</li><li>Return a set containing all values that both sets DO NOT share</li></ol>
# What is the purpose of a dictionary?
# How do you define elements within a dictionary?
# What is the purpose for the range(), len(), append(), and map() functions for a dictionary?
# List and briefly explain the following functions (methods) that can be used with strings:<br>'''lower()''' , '''upper()''' , '''swapcase()''' , '''title()''' , '''captilize()''' , '''split()'''
# Assume you issued the following command in your ipython3 shell:<br>'''course_name = 'Programming with Python''''<br>What will be the output for each of the following Python commands?<ol valuetype="a"><li>'''course_name[12:]'''</li><li>'''course_name[10:]'''</li><li>'''course_name[-1]</li></ol>
13,420
edits

Navigation menu