Python Workout: 50 Essential Exercises MEAP V03 by Reuven M. Lerner
Author:Reuven M. Lerner [Lerner, Reuven M.]
Language: eng
Format: epub
Publisher: Manning Publications Co.
Published: 0101-01-01T00:00:00+00:00
4.2 Sets
Closely related to dictionaries are sets (https://docs.python.org/3/library/stdtypes.html#set), which you can think of as dictionaries without values. (I often joke that this means sets are actually immoral dictionaries.) Sets are extremely useful when I need to look something up in a large collection, such as filenames, e-mail addresses, or postal codes, because searching is O(1), just as in a dict. I have also increasingly found myself using sets to remove duplicate values from an input list — such as IP addresses in a logfile, or license plate numbers that have passed through a parking garage entrance in a given day.
In this chapter, you’ll use dictionaries and sets in a variety of ways to solve problems. It’s safe to say that nearly every Python program uses dictionaries, or perhaps an alternative dictionary such as defaultdict from the collections module.
Table 4.1. Reference table
Name Description Example Link
input
prompt the user to enter a string, and return a string
input("Enter your name: ")
https://docs.python.org/3/library/functions.html#input
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
What's Done in Darkness by Kayla Perrin(26517)
Shot Through the Heart: DI Grace Fisher 2 by Isabelle Grey(19000)
The Fifty Shades Trilogy & Grey by E L James(18952)
Shot Through the Heart by Mercy Celeste(18876)
Wolf & Parchment: New Theory Spice & Wolf, Vol. 10 by Isuna Hasekura and Jyuu Ayakura(16975)
Python GUI Applications using PyQt5 : The hands-on guide to build apps with Python by Verdugo Leire(16868)
Peren F. Statistics for Business and Economics...Essential Formulas 3ed 2025 by Unknown(16796)
Wolf & Parchment: New Theory Spice & Wolf, Vol. 03 by Isuna Hasekura and Jyuu Ayakura & Jyuu Ayakura(16690)
Wolf & Parchment: New Theory Spice & Wolf, Vol. 01 by Isuna Hasekura and Jyuu Ayakura & Jyuu Ayakura(16315)
The Subtle Art of Not Giving a F*ck by Mark Manson(14250)
The 3rd Cycle of the Betrayed Series Collection: Extremely Controversial Historical Thrillers (Betrayed Series Boxed set) by McCray Carolyn(14066)
Stepbrother Stories 2 - 21 Taboo Story Collection (Brother Sister Stepbrother Stepsister Taboo Pseudo Incest Family Virgin Creampie Pregnant Forced Pregnancy Breeding) by Roxi Harding(13414)
Scorched Earth by Nick Kyme(12707)
Drei Generationen auf dem Jakobsweg by Stein Pia(10917)
Suna by Ziefle Pia(10842)
Scythe by Neal Shusterman(10264)
International Relations from the Global South; Worlds of Difference; First Edition by Arlene B. Tickner & Karen Smith(9472)
Successful Proposal Strategies for Small Businesses: Using Knowledge Management ot Win Govenment, Private Sector, and International Contracts 3rd Edition by Robert Frey(9312)
This is Going to Hurt by Adam Kay(9089)
