What does instantiate mean in the context of this lesson?

That is a method of the str class. It is called on the leading string and given the argument that will satisfy the interpolation expression contained in the string.

>>> s = "string"
>>> dir(s)
[
 '__add__', '__class__', '__contains__', '__delattr__',
 '__dir__', '__doc__', '__eq__', '__format__', '__ge__',
 '__getattribute__', '__getitem__', '__getnewargs__',
 '__gt__', '__hash__', '__init__', '__init_subclass__',
 '__iter__', '__le__', '__len__', '__lt__', '__mod__',
 '__mul__', '__ne__', '__new__', '__reduce__',
 '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
 '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
 'capitalize', 'casefold', 'center', 'count', 'encode',
 'endswith', 'expandtabs', 'find', 'format', 'format_map',
 'index', 'isalnum', 'isalpha', 'isascii', 'isdecimal',
 'isdigit', 'isidentifier', 'islower', 'isnumeric',
 'isprintable', 'isspace', 'istitle', 'isupper', 'join',
 'ljust', 'lower', 'lstrip', 'maketrans', 'partition',
 'replace', 'rfind', 'rindex', 'rjust', 'rpartition',
 'rsplit', 'rstrip', 'split', 'splitlines', 'startswith',
 'strip', 'swapcase', 'title', 'translate', 'upper', 'zfill'
]
>>> 

In this list above we see the format attribute.

>>> "string object with {d}".format(d='interpolated expression'.upper())
'string object with INTERPOLATED EXPRESSION'
>>> 

Aside

>>> from random import choice
>>> print ("{}".format("Hooray!" if choice([0, 1]) else "Aw, shucks!"))
Hooray!
>>> print ("{}".format("Hooray!" if choice([0, 1]) else "Aw, shucks!"))
Aw, shucks!
>>> 
1 Like

Thank you so much for posting the links to these videos. Watching them helped me visualize these concepts and understand them.

1 Like

I read this question because I was having the same issue. I read the answers here, and they were helpful. But, power through and get to this sections project (Basta), and do it with the video with Mike. Mike breaks it down really well, and I found actually putting it all together with his thoughts added really brought all of this together. Thanks Mike.

@nayunsung3562491092 thank you so much for the video!! It was very helpful :slight_smile: :slight_smile:

@saraclick hey i am struggling as well :slight_smile: this video really helps! Good Luck to You!

Thanks for this video!

This helped a lot!!! : ) Thank you.

This guy is awesome. In 10 minutes I got everything and all the built-in methods I’ve used so far, now I know how they work. It’s incredible how he links the basics to more advanced stuff so that everything is super-understandable. Thank you so much for the link!

Indeed!
@CodeCademy team: you should be the ones producing such content :wink: take notes! Such channels are actually eating out market shares for your business and you’re missing out on growing your offer for us students. Your courses selection’s great, but some of the material need some polishing and exercise revisions that include such efficient, accessible video content.

But hey, that’s just my two cents advice from my old career.

1 Like

Hi Everyone!

I watched above mentioned videos before landing this thread and tbh they helped a lot.
But now I am in the middle of the topic, I realise some things are still missing.

Below videos really helped me -
If you need more depth on:
Instances, class attributes, creating methods: Python OOP Tutorial 1: Classes and Instances - YouTube
Class variables, instance variables and when each of them is more useful over the other: Python OOP Tutorial 2: Class Variables - YouTube

Hope those will help you as well!
cheers

oh man, thank you so much for this!! I feel like the classes section could have used a higher level breakdown before diving into the lesson.

Here let me explain with a example.
Imagine Google company is a program. Now to work properly it needs its employees to do their specific job.
You can think of those Google employees as Classes which help to keep the program running. Every class has a specific task to do and so on. This what object oriented programming in a nutshell is! It’s the pattern of designing class and giving them certain responsibility to help the program running.

Let me explain you “What instantiate means here” with an example.
Suppose you have created a class which prints out “Hello Word”. The class is not workable if it doesn’t become an object to do the task. When you make class an object and assign it to a variable this is what instantiation is.