Python Morsels Profile
Python Morsels

@PythonMorsels

Followers
7K
Following
58
Media
152
Statuses
2K

Giving life-long learners a low-stress way to hone their #Python skills. 🐍🍪 Write beautiful code. ✨ Made by @treyhunner 💖

Joined January 2018
Don't wanna be here? Send us removal request.
@PythonMorsels
Python Morsels
4 years
Python Morsels gives professional developers a low-stress way to hone their Python skills, through weekly screencasts and exercises. 🐍🍪 It's not a course. And it's not for complete beginners. Try it out: https://t.co/ylveRTs3Tm More details 👇 https://t.co/cOaB9A8kOY
pythonmorsels.com
Practice a new intermediate-level Python concept every week
@treyhunner
Trey Hunner
4 years
Looking for an excuse to deepen your #Python skills? I made @PythonMorsels for you. It's not an Intro to Python course. It's both not a course & includes topics well beyond introductory Python. Don't think "tennis class". Think "weekly tennis practice". 🎾 But for Python! 🐍
1
5
23
@PythonMorsels
Python Morsels
1 year
You'll almost always see tuple unpacking used whenever enumerate is used. for n, fruit in enumerate(favorite_fruits, start=1): print(n, fruit) #Python https://t.co/s1fDQDtkgF
Tweet card summary image
pythonmorsels.com
Python's built-in enumerate function is the preferred way to loop while counting upward at the same time. You'll almost always see tuple unpacking used whenever enumerate is used.
0
1
3
@PythonMorsels
Python Morsels
1 year
You don't need third-party libraries to read CSV files in #Python! Python's csv module includes helper functions for reading CSV files, tab-delimited files, and other delimited data files. 👀💻🔍 https://t.co/Rny3bJv3h4
Tweet card summary image
pythonmorsels.com
You don't need third-party libraries to read CSV file in Python! Python's csv module includes helper functions for reading CSV files, tab-delimited files, and other delimited data files.
0
0
4
@PythonMorsels
Python Morsels
1 year
"When we call this generator function, it doesn't actually run the code in that function!" 🤯 #Python
0
0
5
@PythonMorsels
Python Morsels
1 year
"When we loop over a csv.reader object, the reader will loop over the file object that we originally gave it and convert each line in our file to a list of strings." 🔄💱 #Python https://t.co/Rny3bJv3h4
Tweet card summary image
pythonmorsels.com
You don't need third-party libraries to read CSV file in Python! Python's csv module includes helper functions for reading CSV files, tab-delimited files, and other delimited data files.
0
0
7
@PythonMorsels
Python Morsels
1 year
"Creating a singleton class might seem a little bit misleading to someone using this class." 😖 #Python https://t.co/CdzeJXElkX
0
1
4
@PythonMorsels
Python Morsels
1 year
"The yield statement is what turns a function into a generator function." 🔻 #Python https://t.co/iaFc8opnQi
0
1
6
@PythonMorsels
Python Morsels
1 year
"We've exhausted our generator object; we've fully consumed all the items within it." 🏁 #Python https://t.co/iaFc8opnQi
0
1
7
@PythonMorsels
Python Morsels
1 year
"For a very simple command-line program, you could just rely on #Python to close the file automatically when your Python program exits." https://t.co/kaY154UV3n
0
0
2
@PythonMorsels
Python Morsels
1 year
If we want to start counting at a different number, we can set the start keyword argument when calling enumerate. for n, fruit in enumerate(favorite_fruits, start=1): print(n, fruit) #Python https://t.co/s1fDQDtkgF
Tweet card summary image
pythonmorsels.com
Python's built-in enumerate function is the preferred way to loop while counting upward at the same time. You'll almost always see tuple unpacking used whenever enumerate is used.
0
0
5
@PythonMorsels
Python Morsels
1 year
The built-in str function actually calls the __str__ method on the object that we give it. #Python https://t.co/p9ChRPCaVp
0
2
7
@PythonMorsels
Python Morsels
1 year
"If you'd prefer to think in terms of the headers in your file, rather than in terms of the indexes of each data column, you could use csv.DictReader instead of csv.reader." 📚 #Python https://t.co/Rny3bJv3h4
Tweet card summary image
pythonmorsels.com
You don't need third-party libraries to read CSV file in Python! Python's csv module includes helper functions for reading CSV files, tab-delimited files, and other delimited data files.
0
0
3
@PythonMorsels
Python Morsels
1 year
"Just like with reader objects, we can loop over DictReader objects to get the rows within our file. But unlike reader objects, instead of getting back lists representing each row, we'll get back dictionaries." #Python https://t.co/Rny3bJv3h4
Tweet card summary image
pythonmorsels.com
You don't need third-party libraries to read CSV file in Python! Python's csv module includes helper functions for reading CSV files, tab-delimited files, and other delimited data files.
0
0
3
@PythonMorsels
Python Morsels
1 year
"A singleton class is a class that only allows creating one instance of itself." 1️⃣ #Python https://t.co/CdzeJXElkX
0
2
4