FIFA-2022 Career Guide Free Tutorials Go to Your University Placement Preparation 
0 like 0 dislike
344 views
in Python Programming by Goeduhub's Expert (9.3k points)

1 Answer

0 like 0 dislike
by Goeduhub's Expert (9.3k 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

Learn & Improve In-Demand Data Skills Online in this Summer With  These High Quality Courses[Recommended by GOEDUHUB]:-

Best Data Science Online Courses[Lists] on:-

Claim your 10 Days FREE Trial for Pluralsight.

Best Data Science Courses on Datacamp
Best Data Science Courses on Coursera
Best Data Science Courses on Udemy
Best Data Science Courses on Pluralsight
Best Data Science Courses & Microdegrees on Udacity
Best Artificial Intelligence[AI] Courses on Coursera
Best Machine Learning[ML] Courses on Coursera
Best Python Programming Courses on Coursera
Best Artificial Intelligence[AI] Courses on Udemy
Best Python Programming Courses on Udemy

 Important Lists:

Important Lists, Exams & Cutoffs Exams after Graduation PSUs

 Goeduhub:

About Us | Contact Us || Terms & Conditions | Privacy Policy ||  Youtube Channel || Telegram Channel © goeduhub.com Social::   |  | 

 

Free Online Directory

...