Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pierian-data

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.

GitHub Repository: pierian-data/complete-python-3-bootcamp
Path: blob/master/17-Advanced Python Objects and Data Structures/06-Advanced Python Objects Test.ipynb
Views: 648
Kernel: Python 3

Advanced Python Objects Test

Advanced Numbers

Problem 1: Convert 1024 to binary and hexadecimal representation

Problem 2: Round 5.23222 to two decimal places

Advanced Strings

Problem 3: Check if every letter in the string s is lower case

s = 'hello how are you Mary, are you feeling okay?'

Problem 4: How many times does the letter 'w' show up in the string below?

s = 'twywywtwywbwhsjhwuwshshwuwwwjdjdid'

Advanced Sets

Problem 5: Find the elements in set1 that are not in set2:

set1 = {2,3,1,5,6,8} set2 = {3,1,7,5,6,8}

Problem 6: Find all elements that are in either set:

Advanced Dictionaries

Problem 7: Create this dictionary: {0: 0, 1: 1, 2: 8, 3: 27, 4: 64} using a dictionary comprehension.

Advanced Lists

Problem 8: Reverse the list below:

list1 = [1,2,3,4]

Problem 9: Sort the list below:

list2 = [3,4,2,5,1]

Great Job!