0% found this document useful (0 votes)
108 views5 pages

? Python?interview Questions & Answer

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)
108 views5 pages

? Python?interview Questions & Answer

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/ 5
® python 4. hat is Python? > Fejthon was created by Guide van Rossum, in 1991. + Web appiicatfon are Made by python with the neip of Sexvers. . Fytnon handles huge amount of data % perform mathematics. + Pyinon works on different Platform tice (Mac, Linux, windows , Raspberry pi ete). . Python 1s q object orlented Prog ramming Ignguage - + Python is high level § most popular Progvamm)ng language « =o -6-m- ry You py file Interpreter Bytecodefile. Output 2. Ts the Python case sensitive janjuage - > Yes, Python isa case sensitive language - Because It differentiates +the lower case & upPer cOse IdentfFters. 3. What is Lambda furietion in_fytnon 2 = Lambda function In Python having no name. Lambag forms are uHifzed to Construct anonymous functions. A normal Functions aye defined by lambda Keyword. example :— addev = lambda xX, ys x + Print (adder (4, 8) ) asc Dt Dt il ll al Al ll all ll ll ll all Al A Al el 4. what are th? advantages of Python 2 + Python is very flexible & extenstble language + « Python Is Object oriented Program min | language. 3 «In Python there are Tule , list and dictionary ave ysetul da fs present In the lanquage. grructure grur cumAR (LINKEDIN) Sass ses Dah Dak ak ek Bk Da Dl Dl ll ll al al al ll sl ll al ll ll le Puthon yuns on yayious Plarform ike Mac, Window, Linux , yaspberry pi ete. + Python fs Free and open source language. 5. lthat is PEP 8? adn Futron PEP has appears as the style guide that most Projects hold 40 tts + Ir Provides @ very readable and eye- pteasing code style. » A fun form of PEF ts Python Enhancement Pyoposal - + PEP ® yecommends use G space +0 show Indentation and +abs should only be used +o maintain consistancy tn tne Proqyam. 6 jalhat is seié in Ryton? 7+ By using self Keyinard we can access the athibute ¥ methods ©F class fn Python. +The self Keyword is Used to yepresent the instance oF the class. «The self variable fn the init method yefer to ne newly Created object while In Other methods. + Seik ts glso used to refer 40.9 varianie Field within the class. 4-_What fs Init gunction fn Python ? 4 +_init. is one of the veserved method In Pytnon. « The init. method can be called when an object ts created #x0M the class. ~ An class have a Function called fnit_¢ >. which fs always executed vohen tht class Is being IniHated. + Use the Init_() Function 4o assign values to object Properttes. 2 The init. method doesn't created the objet but only Initialize te object's attributes. ATUL KUMAR CLINKEDIA) eet tad al ll ll le ll ll ll €. What is Pass in Python? 23 The Pass Keyword yepresent @ null operation In Python. ot is Generaiiy used for the purpose of Filling up empty block of code Which may execute during yuntime « +The pass statement }s generally used as 4 Placeholder - = he pass statement is useful when you don't vorite Implement of function . a lalhat is_sitce function In Py thon ? aie furhon gitee( ) function 3s used to get a sitce oF elements from collection of elements. + Stice C) functton used with string , list, tupte, set, bytes Or yange objects. . Syorax : Slice C stop) Stice (start, stop, step) 10. How is Memory managed fn Python ? a: Memory management In python involves @ private heap containing ail python objects £ data structure. + The Python memory manager is deals with storage management aspects, ike shaving , seqmentation and caching - The core API Qlves access +0 some tools for Programmer to code. -idn python stnere Is also garbage collectton ts present. Tt yeeyoes al) the unused memory and so H makes free space in memory. i. alnat Te tuple In Python ? +A tupte ts 9 bullt In data type. « We can stores a value In tuple. + A tuple tn python Ts gimilay to q Itst. « Juples ave immutable so we cannot change its Values. + Tuples vespond to the + and x Operators muth Ike Strings. hl ll a ll a cl al ll NE a Jathat is an operator In Python? aC peratoy is q Symbol which ts used on values to produce output on it + Arithematic operators are used to performing mathematical operation. Vike qdatton, subtract, mulllpitcatton & diviston. + Comparison Operator Lompares tne values and yeturns true of false Values on Conditon. ae Logical operator Perform Log! ca) AND, Loyteal OR and Logica a) NOT operattons. It is used +0 combine conditonag) statements. + Bitwhse operator act on bit £ perform bit- by - blt operattens + Assignment operators used to assigning values 40 the variables. 13. Ts the python Interpreted language? +A Pytnon Is Gn Interpreted language - + Fython tonquage Program yuns dirvectiy from the code- : Ayrhon converts the Source code Into !angquage code. And It ts again translated Into machine tanguage- «An Interpreted language te any Programming language that jsn't alyeady tn mathine code prior to runtime. + Python 1s Fal under byte code Interpreted. « The‘PY code source code te flrst compiled +o byte code as -FYC V4. lnat ave fy thon iterators + — + The Herators ave objects which can be travesed through or Herred upon. + Tterator contgins countable number of vaiues: + Python Iterator used to tterate Object Uke Itst, tuple, and sets. The iterator object Inltialized ustng Trex cy method, 5. What is namespace In fyshon ? 4 A namespace fs naming system used to make cure that names are unlgne to avold naming Conifers. AR _ClinkeoIN) Mek sek Nk ak Dk ll al at a al a ll al alll ll le ll ll lt Yo. Ts Tndentatton vequtred In Python 2 > +Tndentatton ts most net Rue for Python. oTt specifies blows of code- All code with In loops classes functtons ete. + Tt is usuay done using four space character» + Tt your code ts not Intended a + Tt will not execute accurately and wit) through eryor as well 17» What are local and _g1ob4) vartable tn_ Python ? > + There ave two types oF variables local and o10ba) Varigbles. Local Vavlables :— * Local variables can only be yeathed within their scope- + Any variable declared Inside a function fs Known ac 9 Local variable This varlable fs Oresent In the 10ca) and not In +he global space. Global variables :— » A Global varlable Can be used anywhere in the Progvam as irs reope ts entive Program. » Variable declared outside a functon or in globa) pace are called global vartables.. c + These vartables can be accessed by any function in the Progyam.

You might also like