Python Interview Questions for Freshers 2020 Python Basic Inter
These Python interview questions for freshers 2020 will based on questions on python python basic interview questions to make you prepare for your upcoming python interview programs. Practice here program questions in python with these most asked python interview questions and answers. 1. How to install Python on Windows and set path variable Ans To install Python on Windows follow the below steps Install python from this link s www.python.org downloads After this install it on your PC. Look for the location where PYTHON has been installed on your PC using the following command on your command prompt cmd python.Then go to advanced system settings and add a new variable and name it as PYTHON_NAME and paste the copied path.Look for the path variable select its value and select edit .Add a semicolon towards the end of the value if it s not present and then type %PYTHON_HOME% 2. Mention the use of operator in Python Ans It is a Floor Divisionoperator 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. 3. How can the ternary operators be used in python Ans The Ternary operator is the operator that is used to show the conditional statements. This consists of the true or false values with a statement that has to be evaluated for it. Syntax The Ternary operator will be given as [on_true] if [expression] else [on_false]x y 25 50big x if x < y else y Example The expression gets evaluated like if x< y else y in this case if x< y is true then the value is returned as big x and if it is incorrect then big y will be sent as a result. 4. What is the purpose of operator Ans Exponent Performs exponential (power) calculation on operators. a b 10 to the power 20 if a 10 and b 20. 5. What is the purpose of operator Ans Floor Division The division of operands where the result is the quotient in which the digits after the decimal point are removed. 6. What is the purpose of is operator Ans is Evaluates to true if the variables on either side of the operator point to the same object and false otherwise. x is y here is results in 1 if id(x) equals id(y). 7. What is the purpose of not in operator Ans not in Evaluates to true if it does not finds a variable in the specified sequence and false otherwise. x not in y here not in results in a 1 if x is not a member of sequence y. 8. What are the two major loop statements Ans for and while 9. What is the purpose break statement in python Ans break statement Terminates the loop statement and transfers execution to the statement immediately following the loop. 10. What is the purpose continue statement in python Ans continue statement Causes the loop to skip the remainder of its body and immediately retest its condition prior to reiterating. 11. What is lambda function in python Ans lambda is a keyword in python which creates an anonymous function. Lambda does not contain block of statements. It does not contain return statements.12. What is the usage of help() and dir() function in Python Ans Ans Help() and dir() both functions are accessible from the Python interpreter and used for viewing a consolidated dump of built-in functions. Help() function The help() function is used to display the documentation string and also facilitates you to see the help related to modules keywords attributes etc.Dir() function The dir() function is used to display the defined symbols. 13. What is the difference between remove() function and del statement Ans You can use the remove() function to delete a specific object in the list. If you want to delete an object at a specific location (index) in the list you can either use del or pop. 14. What is split() and join() functions in Python Ans You can use split() function to split a string based on a delimiter to a list of strings.You can use join() function to join a list of strings based on a delimiter to give a single string. 15. What is map function in Python Ans map function executes the function given as the first argument on all the elements of the iterable given as the second argument. If the function given takes in more than 1 arguments then many iterables are given. Follow the link to know more similar functions. 16. What are docstrings in Python Ans Docstrings are not actually comments but they are documentation strings. These docstrings are within triple quotes. They are not assigned to any variable and therefore at times serve the purpose of comments as well. 17. Mention the use of the split function in Python Ans The use of the split function in Python is that it breaks a string into shorter strings using the defined separator. It gives a list of all words present in the string.18. What are tuples in Python Ans A tuple is another sequence data type that is similar to the list. A tuple consists of a number of values separated by commas. Unlike lists however tuples are enclosed within parentheses. 19. What is the difference between tuples and lists in Python Ans The main differences between lists and tuples are Lists are enclosed in brackets ( [ ] ) and their elements and size can be changed while tuples are enclosed in parentheses ( ( ) ) and cannot be updated. Tuples can be thought of as read-only lists. 20. What is zip() function in Python Ans Python zip() function returns a zip object which maps a similar index of multiple containers. It takes an iterable convert into iterator and aggregates the elements based on iterables passed. It returns an iterator of tuples. Source URL s gtecvesu.com python-interview-questions-for-freshers Name GTec VesuWebsite s gtecvesu.com Contact 91-89800-21008Email inquiry(at)gtecvesu.com or premware.education(at)gmail.comAddress F 4 Ofira Business Hub VIP Road Surat - 395007
-
श्रेणी: प्रशिक्षण और शिक्षा सेवाएं
महत्वपूर्ण!
Advertigo पर बहुत सारे विज्ञापनदाता हैं। हम उन्हें एक-एक करके जाँच नहीं कर सकते।
आप अपनी मेहनत की कमाई के लिए एक भरोसेमंद कंपनी चाहते हैं। इसीलिए हम आपको धोखाधड़ी से बचाने में मदद करना चाहते हैं। इस अनुभाग में आपको जानकारीपूर्ण सुझाव और अन्य उपयोगी सामग्री मिलेगी जो आपको सतर्क रहने और ठगों के शिकार होने की संभावना को कम करने में मदद करेगी।
कृपया समझें कि Advertigo.net खरीदारों और विक्रेताओं को एक-दूसरे को खोजने में मदद करने के लिए एक निःशुल्क सेवा है। Advertigo.net किसी भी लेन-देन में शामिल नहीं है और हमारे उपयोगकर्ताओं की गतिविधियों पर नजर नहीं रख सकता।
उपयोगी लिंक
समान विज्ञापन
Distance btech start your engineering journey with ease
Transform your passion for technology into a recognized qualification with a comprehensive Distance B.Tech program...
Rafiya
Distance mtech upgrade your engineering skills remotely
Take the next major step in your engineering journey with a highly flexible Distance M.Tech
Rafiya
Online mtech master advanced engineering digitally today
Accelerate your engineering trajectory without stepping away from your current job with a premium Online
Rafiya
Online bca course code your digital future with top universitie
Step into the digital future with a premium Online BCA Course designed for ambitious students
Rafiya
Online mca course master ai tech with indias top universitie
Ready to master the future of technology? A premium Online MCA Course is your gateway
Rafiya
Top web designing institute in laxmi nagar delhi
Choose a professional training program that helps you develop practical and creative web design skills...
Muskan Sharma Seo
Video editing course for creative careers
Skillwaala’s Video Editing Course helps learners develop creative video editing skills with practical techniques, editing
Skillwaala
Riim academy
# MPSC Academy in Pune: Why the Right Guidance Matters More Than Ever
Preparing for the
John Flip
Digital marketing course in bhopal india build your digital s
Businesses are increasingly using digital platforms to connect with customers and promote their products and
Yash Shrivastava