0% found this document useful (0 votes)
26 views6 pages

?python? Series - 2 Part - 2

Uploaded by

Sankeerth Reddy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
26 views6 pages

?python? Series - 2 Part - 2

Uploaded by

Sankeerth Reddy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 6
PYTHON — FULL COURSE Python. @ LTrtoductio Python js a Cyoss - Plarfoxm_ pPyo9vamming Language, which means thar it can vun on Multtple plarforms. Uke windows Inux, aNd has been even proted {0 the_fova and -NET_vivtual ines. It ts Free and open- Source. Atui kumar (Linkedin): NOTES GALLERY (TELEGRAM), @ Your Fivst Python program. Lets create @ very simple progyam called ‘Hello world’ Type the following code fn editor oy an IDE and Save it as _hello_ world. Py_- : (Pxint_Cneulo, world! ")) You willl get the Pojowing Output. Hello, Wold AS you cOn see, this Was a_pyetty_eacy tack. TAle Ts the beauty of the python progvamming_ @ Python Keywords | KeyWord ave the yesovved Word in Python: We cannot use A Keyword as a variable name, function name oy any Other identifers. They aye use to define _ Syntax and structure of the python language. Fase Pass yale hon local Passe [der] ovat not _| gies All the KeyWords except_Ivue, False and None are tn 1oWer case and they must be Written as they are. @ PYthon Identifiers : An §dentifiers js a name Qiven to entities Uke Class, Funutlons, vartables , ete. KeyWord cannot be used as identiflers Frie “< interactive input >", Ine 1 lobal = > cer auaarcrs caueeemea | A | Sgntax evvor: Invalid Syntax | ni i We cannot uce special Symbol like! , @ #4, 1 ett., In our identifier. a@=0 Arul Kumag (uNKeDiny . Frie “< fntevactive input >", tinet Syntax Exvor: invalid Syntax @ Syntax of function : def function. name (Ravameters ): docst ying" ee Statement CS ) wow @ Example of a function: def Areet (name): Th... 42 This Function greets to the Person Passed tn as a Pavameter Vt t Print (“Hello, “t+ name t "Good Moxning!”) NOTES earcea CTELEGRAPD, @ How to call a function in Python? >>> greet (‘Pau ') Hello, Paul. Cyood Morning t PYTHON OBJECT ORIENTED PROGRAMMING — Class: Pass —> Object: => Methods: Methods ave Functions defined Inside the body pF 4 class. They Ave used to define the behaviours of an Object. => Inhevitance: Tnhevitance js Q wioy of creating @ ned class for using details of an existing class without modifying it. The newly formed class 1s derived. => Encapsulation: Using OOP fn python, We can xesteiet Access t> Methods and ya@yiable- This prevents data From direct modification . = Polymorphism: It fs an abidty Cin oop) to use 9 Common InterFace for multiple forms (data type). NOTES GALLERY (CTELEGRAYW) INBUILT DATA STRUCTURE ' @ Creating alist: 4] My_iist =0J + Creating empty tist. _2| Print (my_ ttt) _3-|My_ ist = £1,2,3 ‘example! 3.132) + Creating list 4} print (my_ List) With data. e Creating a dictionary ; 4,| My- dict = {) # empty dictlonary . 2| Paint (My_ dict) _3-|My_diet= (4: ‘Python’, 2: ‘Java'> 4F dictfonary with el * 4 | paint Umy_aict) cosa ATU KUMAR LLINKEDIN) » 2 NOTES LERY (TELE @ Cveating a tuple Cate 4.) My_ tuple = (1,2,3) ## Create tuple 2. | Print (My_ tuple) @ Creating a set 4, | My-Set = €1,2,3,4,5.5,5 } # Create set 2] Print (My- Set.

You might also like