90 likes | 110 Views
Sidhi Trainings offer a unique opportunity for individuals seeking to accelerate their careers by learning trending and advanced software. Our courses are designed to provide comprehensive instruction in the latest technologies, covering everything from fundamentals to advanced concepts.
E N D
PYTHON HTTPS://SIDHITRAININGS.COM/
WHATISPYTHON Thepopularhigh-levelprogramming language Python is used in a variety ofapplications. Python'sstraightforwardsyntax makesitasimplelanguageto learn. Python may be used for straightforward tasks like graphingormoredifficultoneslike machinelearning.
VARIABLES,OBJECTS,&CLASSES Variable Avariableisapointertoavaluekeptinthememoryofa computer. A variety of categories (or data types) can be used to group variables, including integers (int, float, etc.), Booleanvalues(true/false),andsequences(strings,lists, etc.). Object Anobjectisagroupofmanipulatabledatafromacomputer's memory. Despitethefactthatcertainobjectsmightbedefinedbydata referredtobynumerousvariables,ALLVARIABLESAREOBJECTS. Theactionstakenonorchangesmadetoanobject's dataarecalledmethods.Theyexplainwhatanobject can"do."
VARIABLES,OBJECTS,&CLASSES Class Aclassisagroupofobjectsthatallusethesame variablesandfunctions. Alloftheobjects(instances)thatmakeuptheclasshave ablueprintinthedefinitionoftheclass. The same variables (colour, size, shape, etc.) may be presentinseveralinstances,buttheydonotallhavethe samevalues(blue/red/pink,small/large,square/circular, etc.).
BASICSYNTAXRULES Yourvariable'sname(myInt,etc.)ispositionedtotheleftofthe"=" operator. Themajorityofvariablenamesareincamelcase,whichstartswitha lowercaseletterforthefirstwordandcapitalisesanyfollowingterms. In snake case, all words are lowercase and there are underscores betweenthem,variablenamescanalsooccur. Thevariablenameissetequaltothememoryaddresswhereyour valueisstoredviatheassignmentoperator("="). The"Hello,World"variablevalueispositionedtotherightofthe"=" operator. Thisvalue'stypeneednotbespecified,butitsformatmustadhereto acertainobjecttype(asillustrated).
BASICSYNTAXRULES FunctionSyntax Whenyouusethedef...keyword,youaredeclaringanewfunction. Thenameofyourfunctionisreferredtobyfunction().Thistermis oftenwritteninlowercaseanddesignatesaverboraction. Theterms"parameters"(i.e.,"values"or"variables")thatcanbeused withinthedefinitionalexpressionsofyourfunctionare"a"and"b."An emptyparenthesis()isusedifyourfunctionhasnoparameters. Anoptionalstatementcalled"return"willsendavaluefromyour functionbacktotheoriginalcall.
BASICSYNTAXRULES Callingafunction Use the function's name (function()) to invoke it, followed by any requiredparameters(1,2)enclosedinparenthesesandseparated bycommas.:function(1,2);myValue Youhavetheoptionofsettingyourfunctioncall'sargumentequalto avariable(myValue).Yourvariablenamewillbesettothefunction's returnvalue.
COMMONDATATYPESANDOPERATORS BUSINESS A data type is a way to categorise a value and specify the actionsthatmaybecarriedoutonit.Anobject'sdatatypeis universal. Operatorsaresymbolsthatperformcertaintasksorcalculations.