GOEDUHUB Online Courses || Last Batch Student's Projects || COVID-19 Projects(AI-ML) || Universities  ||  Placement Preparation  Subscribe our youtube channel
+91-7976731765 Free Online Tutorials ||  MACHINE LEARNING || NLP ||  OpenCV || Python || DBMS || OOPs || DSA || Java || Linux/Unix ||  C Programming
0 like 0 dislike
in Python Programming by Goeduhub's Expert (8k points)

1 Answer

0 like 0 dislike
by Goeduhub's Expert (8k points)
Best answer

Q1. What is pickling and unpickling?

Ans. Pickle module accepts any Python object and converts it into a string representation and dumps it into a file by using dump function, this process is called pickling. While the process of retrieving original Python objects from the stored string representation is called unpickling.

Q2. How Python is interpreted?

Ans. Python language is an interpreted language. Python program runs directly from the source code. It converts the source code that is written by the programmer into an intermediate language, which is again translated into machine language that has to be executed.

Q3How are arguments passed by value or by reference?

Ans. Everything in Python is an object and all variables hold references to the objects. The references values are according to the functions; as a result you cannot change the value of the references. However, you can change the objects if it is mutable.

Q4What are generators in Python?

Ans.  The way of implementing iterators are known as generators. It is a normal function except that it yields expression in the function.

Q5In Python what are iterators?

Ans.  In Python, iterators are used to iterate a group of elements, containers like list.

Q6What is module and package in Python?

Ans.  In Python, module is the way to structure program. Each Python program file is a module, which imports other modules like objects and attributes.

The folder of Python program is a package of modules. A package can have modules or subfolders.

Q7What is the difference between Xrange and range?

Ans.  Xrange returns the xrange object while range returns the list, and uses the same memory and no matter what the range size is.

Q8. Mention what are the rules for local and global variables in Python?

Ans.  Local variables: If a variable is assigned a new value anywhere within the function's body, it's assumed to be local.

Global variables: Those variables that are only referenced inside a function are implicitly global.

Q9. How can you share global variables across modules?

Ans.  To share global variables across modules within a single program, create a special module. Import the config module in all modules of your application. The Module will be available as a global variable across modules

Related questions

0 like 0 dislike
1 answer 37 views
asked Oct 7, 2019 in Python Programming by Goeduhub Goeduhub's Expert (8k points)
0 like 0 dislike
2 answers 145 views
asked Feb 7 in Tutorial & Interview questions by Goeduhub Goeduhub's Expert (8k points)
 Placements:   List of companies | Logical Reasoning Questions | Quantitative Aptitude Questions | General English Questions | Technical-MCQ and Interview Questions
 Important Lists: List of NITsList of IITsList of Exams After Graduation | List of Engineering Entrance Examinations (UG/PG)College ReviewsCollege Fest, Events & WorkshopsKnowledge ShareTrainees/Interns After 15-04-2020
Exams & Cutoffs: JEE Main | JEE Advanced | GATE | IES | ISROList of PSUs || Cutoff-GATECutoff_IIT-JEECS-ScopeECE ScopeEE-Scope
 Download Previous Year Papers For:  GATE | IES | RAJASTHAN TECHNICAL UNIVERSITY (RTU-Kota)RPSC Technical Exams | ISRO
About Us | Contact Us   Social::   |  |