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
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! π
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
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
"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
"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
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
"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
"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