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 || AI || ML || NLP ||  OpenCV || Python || DBMS || OOPs || DSA || Java || Linux/Unix ||  C Programming
0 like 0 dislike
in Python Programming by Goeduhub's Expert (8.1k points)

1 Answer

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

Q10.  Explain how can you make a Python Script executable on UNIX?

Ans.  To make a Python Script executable on UNIX, you need to do two things

  • Script file's mode must be executable and

  • the first line must begin with # ( #!/usr/local/bin/python)

Q11.  Explain how can you access a module written in Python from C?

Ans.  You can access a module written in Python from C by following method,

Module = =PyImport_ImportModule("<modulename>");

Q12.   Mention the use of // operator in Python?

Ans.   It is a Floor Division operator, which is used for dividing two operands with the result as quotient showing only digits before the decimal point. For instance, 

10//5 = 2 and 10.0//5.0 = 2.0.

Q13.  What does this mean: *args, **kwargs? And why would we use it?

AnsWe use *args when we aren’t sure how many arguments are going to be passed to a function, or if we want to pass a stored list or tuple of arguments . to a function. **kwargs is used when we don’t know how many keyword arguments will be passed to a function, or it can be used to pass the values .   of a dictionary as keyword arguments. The identifiers args and kwargs are a convention, you could also use *bob and **billy but that would not be, wise.

Q14.  What is the Difference between Python 3 and Python 2 ?




It is more stable and transparent version of python programming language.

It is future of Python designed to address the design flawn in the previous versions.

The print syntax is treated as a statement rather than a function that requires text to be wrapped in parenthesis. 

The print is explicitly treated as a function and replaced by the print() function in Python 3 which requires an extra pair of parenthesis.

ASCII string type is used by default to store strings.

Unicode is the implicit string type by default.

It simply returns an integer to the nearest whole number when dividing two integers.

It makes integer division more intuitive by using true division for integers and floats.

xrange function reconstructs the sequence every time.

xrange is replaced by range() function in Python 3.

Q15.  What is Enumerate() Function in Python?

Ans.   The Python enumerate() function adds a counter to an iterable object. enumerate() function can accept sequential indexes starting from zero.


About Us | Contact Us  © goeduhub.com Social::   |  | 
 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