Free Python tutorial for beginners-Python Programming - SETATTR() in class def () __init__ method

preview_player
Показать описание
Free Python tutorial for beginners-Python Programming - SETATTR() in class def () __init__ method

#python#pythonprogramming #pythontutorial #pythonforbeginners #pythonclass #youtubechannel #pythoninstallationcomplete #pythonhowtoinstall #pythoninstall #pythondownload #pythontutorialfree #pythonyoutube #pythonenglish #pythonenglish #pythonexecvseval #pythonexec()vseval() #pythonexec() #pythoneval() #youtubeviews #pythondef #pythondef() #pythonfunctions #pythonbreak #pythoncontinue #pythonpass #pythonzip #pythonunzip #pythonprintescapecharacter #pythonrepr() #pythonreduce #pythongetattr
Please Captions on - Python in English, Python in Tamil, Python in Telugu, Python in Malayalam, Python in Chinese, Python in Japanese, Python in German, Python in Hindi, Python in French, Python full course for beginners

------------------------Transcript--------------
hello welcome to technology platform so earlier class we have seen like how to get the attribute in class definition in it everything we have seen it but today we are going to see like how to set attribute and then how to get the attribute that things we can say let me open init class sorry idle so now I'm just mentioning the same class my tutorial and then I can say like course name not course name I can say like def in it itself and then I'll mention like self comma course name comma chapters as you know very well in this now self dot course name equal to course name

and then self Dot chapters equal to Chapters this is you know very well now we already seen like um call my tutorial equal to you're calling you're just first setting the value right so to do real and then passing the value python 10. so how do you get the values like print and then get 880 TR now here you can see like call my tutorial comma course name

column does not exist if column is not present does not exist right so if I mention spelling mistake

then it will gives this message because of the imprinting you already seen it so now see this this is get attribute python but now I want to change this value so I used 10 right but something I want to use it differently let's see this now I want to reset the value so for the reset I want to use like set attr IB right and then I'll say like um here itself we can use it let's see set attr enter I'll type enter set attr Open Bracket call my tutorial comma chapters 10 I passed right I can say like chapters you can pass double quotes or single quotes anything so I can pass it this one I can say like the chapter is like 20. right now you can use the same print but this time chapters you're going to call it now let's see 20 but we have passed it like 10 but here we have passed set at like 20 because of that it is printing like this now I can say like call my tutorial Java right now here you can see

printing Java but now I am just setting the value like course name python

now you can use the same value

you can see python no Java so this is what how to set the value

so I hope you understand see you in the next class bye
Рекомендации по теме