
Giving life-long learners a low-stress way to hone their #Python skills. ššŖ Write beautiful code. ⨠Made by @treyhunner š
Joined January 2018
- Tweets1.5K
- Following5
- Followers6.8K
- Likes58
"When we call this generator function, it doesn't actually run the code in that function!" 𤯠#Python
youtube.com/watch?utm_campaiā¦
"Creating a singleton class might seem a little bit misleading to someone using this class." š #Python
youtube.com/watch?utm_campaiā¦
"The yield statement is what turns a function into a generator function." š» #Python
youtube.com/watch?utm_campaiā¦
"We've exhausted our generator object; we've fully consumed all the items within it." š #Python
youtube.com/watch?utm_campaiā¦
"For a very simple command-line program, you could just rely on #Python to close the file automatically when your Python program exits."
youtube.com/watch?index=1&liā¦
The built-in str function actually calls the __str__ method on the object that we give it. #Python
youtube.com/watch?utm_campaiā¦
"A singleton class is a class that only allows creating one instance of itself." 1ļøā£ #Python
youtube.com/watch?utm_campaiā¦
"Generator objects will do work as we loop over them." š #Python
youtube.com/watch?utm_campaiā¦
Python has 4 scopes: local, enclosing, global, and built-ins.
#Python
youtube.com/watch?utm_campaiā¦
"Local variables are defined inside of a function, and they only exist inside that function. The arguments given to a function are an example of local variables." #Python
youtube.com/watch?utm_campaiā¦
"We can make a singleton class by customizing our class to have a custom constructor method." š ļø #Python
youtube.com/watch?utm_campaiā¦
"You can think of creating a tuple as packing values together and unpacking a tuple as undoing that work. We're unpacking each of the values in our tuple above into separate variable names." #Python
youtube.com/watch?utm_campaiā¦
"While we *can* rely on #Python closing files automatically when our Python process exits, but we usually shouldn't rely on that unless we want our file open for the entirety of our Python process."
youtube.com/watch?index=1&liā¦