Quick Quiz Answer class shop: def __init__(self,sales,expenditure): self.sales=sales self.expenditure=expenditure def __call__(self): print(F"The total profit is {self.sales-self.expenditure}") shop1=shop(15000,12000) shop1() Output: The total profit is 3000
@GameWithStuff8 ай бұрын
Thanks
@armaanaujla6306 ай бұрын
class shop: def __init__(self, expend, sales): self.expend = expend self.sales = sales def __call__(self): if int(self.sales) - int(self.expend) > 0: print(f"The total profit is {int(self.sales) - int(self.expend)}") elif int(self.sales) - int(self.expend) < 0: print(f"The total loss is {int(self.expend) - int(self.sales)}") else: print("No Profit or Loss.") day1 = shop(50000, 70000) day2 = shop(387419, 257692) day3 = shop(50000, 50000) day1() day2() day3() Output: The total profit is 20000 The total loss is 129727 No Profit or Loss.
@mansoorsarookkh3 ай бұрын
thumbs up
@irfanmohammad2132 Жыл бұрын
I think the practicle use case of def__call__(self ) : method will be to add conclusion to a class or it can used to find total amount at the end of class
@swatidixit6459 Жыл бұрын
Reached #day 73 and realllyy enjoying each day and gaining knowledge :) Harry sir you are great!!!!!
@ahsantariq3926 Жыл бұрын
Call method can be used to use a class instance like a function. We can give arguments and executes it however we want
@i_am_dumb1070 Жыл бұрын
I have never been this consistent with my learning enjoying every minute of this course
@mansibarewar62958 ай бұрын
true
@theankitsagarit Жыл бұрын
Very good and informative content.... This is the most user friendly and learner friendly tutorial channel. Harry bhai 9999 kilo shukriya...
@Realgemigindian777RealgemigindАй бұрын
class Nt: def nert(self,n): self.n = n def m(self): print(f"thakiQ yujig disa cod {self.n} PRo !") a = Nt() a.nert(input("antra yuar nema: ")) a.m() Thankiyu aap ne ye cod ko pda ❤
@technomusiccloud97225 ай бұрын
quickquiz answer🔥🔥🔥 __call__ can be used in a same fasion as help() like to descripe an object and its properties in a readable format
@rahmansherif Жыл бұрын
QUICK QUIZ ANSWER: class calculator: def __init__(self, base): self.base = base def __call__(self, x): return self.base + x c = calculator(10) print(c(5))
@thekibouminecraft93617 ай бұрын
15
@veersinghchauhan68858 ай бұрын
At 7:45 why is it executing only the str method and not the repr method . Even though we have not called either of them while typing print(e). Can anyone help 🙏
@PIYUSHFFYT8 ай бұрын
repr run's if it didn't get any str if it get str then you need use repr() fuction to call it
@RahulVyas-ds4uv16 күн бұрын
Bcz he called this class only once
@probalkar6066 Жыл бұрын
Harry bhai plz start a machine learning ultimate course too from beginner to advanced really need it 🙏🏼🙏🏼
@sanskarsingh2504 Жыл бұрын
yes
@rinkukumari4438 Жыл бұрын
Yes
@meenakshi_gupta Жыл бұрын
Yes
@pradhyudh Жыл бұрын
Yes
@SonamKumari-xh4jy7 ай бұрын
Yes
@sanjeevthakur6837 Жыл бұрын
call function practical use might be to check the functions in the element
@arpankarmakar16 Жыл бұрын
Quick Quiz: Harry sir in the short time I only found this little application of the __call__ under method: import random import string class Employee: def __init__(self, name) -> None: self.name = name def __call__(self, *args, **kwargs): # this makes the instance callable self.id = "".join( random.choices(self.name + string.ascii_letters + string.digits, k=6) ) print(f"The Employee's ID: {self.id}") e = Employee("Arpan") e() # The dunder/magic method __call__ here, prints the Employee's randomly generated 6 character ID
@saradasarawagi662211 ай бұрын
10:40 to know don't of the major details of class or every object of class or get the information of class
@mehmoodahmed19806 ай бұрын
__call__() Method is used to make the instance of class object callable. class Callable: def __call__(self): return "Instance is Callable" instance = Callable() print(callable(instance)) #return True if callable instance() #calling the instance
@LogicOfComputerScience Жыл бұрын
Harry bhaiya, I request you... Aap please apne interpreter ka size bada rakha kare. Or console ko small size me rakhe take dekhne me or samajh ne aasani ho... Thank for teach us.
@mohankilari1747 Жыл бұрын
bro we can actually use the printing of length of name by print(len(e.name))
@narendraparmar163111 ай бұрын
Thanks Harry for your efforts.
@regulusblack8009 Жыл бұрын
I think the practical use case of def__call__(self ) : is to add a definition or conclusion of a class which can easily be obtained
@manik6621 Жыл бұрын
bhai i am just curious , yeh pakistan mai koi teachers nhi hote kya online ? sab indian teachers kai comment section mai hi hote hai .!
@aiapro430611 ай бұрын
@@manik6621 bhai i am just curious, why r you crying?
@priyanshupanda26789 ай бұрын
11:09 the call method can be used to describe the function of the class
@Nikkichaudhary979 ай бұрын
Hello kya ham dost ban sakte hai sirf python ikhne k liye?
@parwatsingh677 Жыл бұрын
OP python course 👌👍👍👍🙏
@sasticoaching67387 ай бұрын
Prctical use case might be to use the class as an argument to The Function like it may return a list which can be used as a argument in a funcion
@UdakshuShorts Жыл бұрын
best teacher🤩
@avinashyt29422 ай бұрын
Best use case. 😅 emp1 = Employee("Harry") emp1() Terminal: Users\Desktop\Code With Harry\100 Days of Python> He is a Naughty Boy😂😂
@ishitagarg278711 ай бұрын
Thanks! You are awesome :)
@siwachjay Жыл бұрын
BRO, At 3:26 you can also write ----- print(len(e.name))
@HuzaifaKhan-iy5qj4 ай бұрын
Harry bhi, you've unnecessarily complicated this lecture, and I needed to understand it from Jenny's lecture.
@shivastar11485 ай бұрын
I am glad to watch now
@amankumarverma8426 Жыл бұрын
Harry bhaiya, if we use print(len(e.name)) then it works fine though
@codegenius9521 Жыл бұрын
i think call method can be used by the programmer to tell about the class in simple words
@mdsohanurrahmanhridoy1343 Жыл бұрын
#Completed Day#73/100😍
@rahulatal18166 ай бұрын
Bro, pls guide for major difference between __new__ and __init__ If __init__ is also a auto-constructor and initializer then why we use __new__ What is the benefit of using __new__ and what problem we face if we Do not use __new__
@meditationmusic6482 Жыл бұрын
Thanks sir.
@omerqureshi3430 Жыл бұрын
The spelling of object is wrong on 0:12
@AbdulHadi-qq9hp Жыл бұрын
But sir, we can print the len of name like : # Coding : class Employee: name = "harry" # def __len__(self): # i = 0 # for c in self.name: # i += 1 # return i e = Employee() print(e.name) # print(len(e)) print(len(e.name))
@AhmadKhan-di2cq4 ай бұрын
i=i+1 then work
@theroshantune Жыл бұрын
there is only 27 days left to complete this course and i am super excited to see me at day 100 thanks MR. Harry for this amazing course
@nitiksharma3182 Жыл бұрын
bro it's useless just do competitive coding
@mariamhasan3733 Жыл бұрын
@@nitiksharma3182 You know competitive programming requires basics. We can jump on CP right after knowing the basics and applying our knowledge.
@nitiksharma3182 Жыл бұрын
@@mariamhasan3733 for cp you don't require these additional libraries and concept. These concepts sounds good but off no use at current scenario.
@i_am_dumb1070 Жыл бұрын
@@nitiksharma3182 you are learning for the sake of getting a job but there are people like me who are interested in programming and making their own programs and work on personal projects. Enjoy what you do and take everything as a new experience to learn from Coding is not a pressure its more like a hobby for me.
@nitiksharma3182 Жыл бұрын
@@i_am_dumb1070 sorry bro, I am wrong. you opened my eyes
@RasheedKhan-hy6ml Жыл бұрын
harry bhai react native par b 1 playlist banaoo
@PhantomX7157 Жыл бұрын
Love you ❤️❤️
@lakshyachaturvedi27126 ай бұрын
mere me __str__ use karne par bhi "" ye likh ke aa raha hai jo double quotes me likha hai kya karun?
@shubhamsaini4871 Жыл бұрын
Harry bhai aapne 1 baat batai thi ki.. python me sab object hota hai.. please explain how?
@hamrosolution88Ай бұрын
call method can be used to give final conclusion
@akhtarhameed360 Жыл бұрын
Harry bhai ik request hai python k bad php k b modern version k course lana
@techbar000 Жыл бұрын
write sir.
@SaigopalakrishnaMaya-j5u9 ай бұрын
harry bhai in my code i can't get like you if i call the str or repr then also it prints the same thing that what printed in first with out them can you solve it
@pankajsinghbisht76 Жыл бұрын
Present Sir #day73
@rajkushwahar Жыл бұрын
ye samjh nhi aaya agar lenth hi nikalni thi to len() ya count() lete phir call kar lete __len__() ka kya faida?
@miri_maau4 ай бұрын
at 2.31 we can write print(len(e.name)). It will give len of name. What is the need of __len__(self)method ?
@RishabBharathiАй бұрын
print('hello world') se start kiya aur aaj hum edhar hain
@RishabBharathiАй бұрын
⬆
@dr.syedinayatullah9125 Жыл бұрын
Mene aap ka lecture 6 min tak suna lekin muje andaza hogyaa ke muje kuch samaj nahi ane wala. Ab google search kia to muje samaj agaya.
@sudhansubalasahoo Жыл бұрын
QUICK QUIZ ANSWER: We would like to make a class callable to give it some functional ability by calling it using '()'. Like we can create a calculator class and make it callable by giving it some operation inside the parenthesis and call the methods inside the class Well that's what I can think of, if you have any more suggestion, please comment down below
@arpankarmakar16 Жыл бұрын
I wrote a comment on a practical use case I thought of. Please review it
@sudhansubalasahoo Жыл бұрын
@@arpankarmakar16 where?
@shivamchaudhary8592 Жыл бұрын
#Day73 Present Sir
@mark_jugarberg Жыл бұрын
harry bhaiya i hope i get knowledge like you😍You are alway my inspiration love from bihar🧡
@stain5570 Жыл бұрын
today I think I will finally complete this course I will grind the whole 27 remaining videos in one day
@mansibarewar62958 ай бұрын
really but will you understand info overload???????
@stain55708 ай бұрын
@@mansibarewar6295I already know lots of programming languages so it's not that hard
@ketanverma78394 ай бұрын
can this be written print(e.__len__()) ? instead of print(len(e))
@codyandersan Жыл бұрын
When will you teach us about Walrus Operator??
@dhananjayadk4611 Жыл бұрын
Hi Harry bhaiya 💞 from Karnataka
@pradhyudh Жыл бұрын
Hai ,i am from Bengaluru
@sarv4265 Жыл бұрын
# try to make an object of this LCM class and call it """ from {file_name} import Math a = Math.LCM(6, 14) a() # gives lcm of the two numbers passed in LCM class """ class Math: class LCM: def __init__(self, num1, num2): self.num1 = num1 self.num2 = num2 # checking which number is greater if self.num1 > self.num2: self.smaller = self.num2 self.larger = self.num1 elif self.num1
@badalsahoo3902 Жыл бұрын
Big fan harry bhai😎
@46h1nav Жыл бұрын
Lal phool neela phool Harry bhaiya beutiful
@dharvikop Жыл бұрын
Day 73 done
@Khemchandbhatiya4 Жыл бұрын
I think here we write print so we use it as a function call and we get to know that function is call and it is written in print and we call it easily "call" it not "print" that's my pint other I would to know in my answer
@letscatchup58697 ай бұрын
thank you
@AbhishekKumar-jh4cb Жыл бұрын
sir print (len(e.name)) use kr sakte h naa
@aniketkewat Жыл бұрын
Bhai kotlin ka course banao na
@GlitchyGlobe11 ай бұрын
Yeh vide thori difficult thi harry bhai
@ParshuRam-ey6iz Жыл бұрын
if i don't keep your photo in my room then i am not worthfulll to watch your priceless vdos 4 free.Thanks
@lakhyadeepsen Жыл бұрын
Day 73 of 100 of python challenge completed. #100DaysofCode #100dayspythonchallenge
@prajwalm.s7976 Жыл бұрын
Repeat what you learn till you get hold of it@heavydrivergaming7831
@aryansinha18184 ай бұрын
04:30
@abhibagwan6895 Жыл бұрын
Harry bhai ek video listing kese hoti h us par bnao plzz 🥰❤️
@bhagyabajoria Жыл бұрын
Sir, I have a question regarding DNS for server: Should I use Cloudflare or Let's Encrypt?
@jp-yu5wz Жыл бұрын
I'm present 💝
@pradeepgavhane3471 Жыл бұрын
Super bro
@R_vis Жыл бұрын
Harry bhai apne intro mein object ki spelling galat likhi h 😂 hn pta h apko aati h spelling or vo apne nhi likhi h but ek complete video chiyee thi linux k uppr pure din search krne prr bhi linux ka kuch nahi milta or i think coding ka itna high quality content koi nhi bnata so please do something!!! and i don't have much money to those paid courses on other sites ......... HARRY HACKER👍
@NEERAJ-dw9bt8 ай бұрын
Present sir 🤚
@v_i_e_s_s_e Жыл бұрын
Harry bro 🙌
@arpankarmakar16 Жыл бұрын
Present sir on #Day73. Kuch bekar k chizo main phas gaya tha isliye itne backlogs bane 😞
@gauravpawar2993 Жыл бұрын
don't be sad it's time to grow up and rock
@manashibarman20363 ай бұрын
Sir mera replit free hours khatm ho chuka hai 😢. I use replit in mobile
@anshuvirat45 Жыл бұрын
print(len(e.name)) isse v length nikal sakta h
@volcano_ff4 ай бұрын
Hello sir aa saab kaha work karega 😢😢😢
@Manish-qt1bz Жыл бұрын
Present Sir 🔥
@sudhansubalasahoo Жыл бұрын
Present Sir
@hackproud Жыл бұрын
Namaste bhabhi 🙏❣️
@SassyShubhi9 ай бұрын
mjhe oops ke concept se jada kuch smjh ni aa rha h koi help kro kaise pdhu me
@wonderscraft9 ай бұрын
same bhai bahut hard hai
@SassyShubhi9 ай бұрын
@@wonderscraft toh kaise krr rhe ho aap help krdo meri bi sath me ho Jayega
@henilrupawala Жыл бұрын
Present ✋🏻Sir
@pubpubji112110 ай бұрын
Bhai call method smjh me nhi aya 😵😵 baki sab aa gya
@Hivefusion Жыл бұрын
Day 73🔥
@uchiha_god_404 Жыл бұрын
#Harrybhai I am in your day 6 I just want to tell u that you have told that this is 100days course but you have taken 1 year to complete but 72% only complete your first video was uploaded in 2022 and it's 2023
@arpankarmakar16 Жыл бұрын
Mf it was uploaded on the last week of Novemeber 🤦♂
@Radhe_radhe2929 Жыл бұрын
Day 73 🔥
@RohanDasRD Жыл бұрын
Day 73 Done
@gauravsethi17 Жыл бұрын
bro print(len(e.name) is working
@MokshMishra Жыл бұрын
that is asnwer of queck qustion
@ayeshaakram30734 ай бұрын
someone pls mention the __int__() video
@TasinIslam-mc2dkАй бұрын
4.11.2024 day 73 is done.
@asifjavaid67004 ай бұрын
Is lecture ki bilkul smjh nai aiii 😢. Can anyone please explain in simple terms that what are magic methods and why they are used ?
@Zayan7909Ай бұрын
They are just methods defined in a class but they have some speciality like you can see init it is automatically called whenever an object is made . str method prints the short information of the created object
@PhantomX7157 Жыл бұрын
Like krrke bhi jao yyrr
@Relatable2U.6 ай бұрын
Did something noticed joker mask?
@akbarhusainbhoraniya6949 Жыл бұрын
kuki error nhi de esliye
@SaiKiranRK-w2h Жыл бұрын
# Kya hum ne __repr__ ko call kiya? # !!!!NAHI!!!!! why?
@vatsalshingala3225 Жыл бұрын
❤❤❤❤❤❤❤❤
@Uploader12 Жыл бұрын
😍😍😍😍
@neerajtripathi3523 Жыл бұрын
Jaldi jaldi comment kar deta hu like milega 😃😃😛😛
@soriful9417 Жыл бұрын
🤣🤣🤣
@neerajtripathi3523 Жыл бұрын
@@OmDeshmukh00 according to you, what is fresh ? Wahi laya jayy😛😛😂😂