The xrange() function is used in Python 2 to iterate in for loops. This means that if you want to make your code run faster then using the threading package often isn’t a good idea. How to implement Python program to check Leap Year? As Python has no concept of private variables, leading underscores are used to indicate variables that must not be accessed from outside the class. PYTHONPATH is sometimes preset by Python Installer. Ans: In Django, there are three possible inheritance styles: Ans: We will use the following code to save an image locally from an URL address, http://webcache.googleusercontent.com/search?q=cache:URLGOESHERE. With this, the equivalent code line of the above code block would be as follows: The following code can be used to sort a numerical list in Python: The function list.reverse() reverses the objects of a list. Thanks a lot guys, Keep up the good work. Some file-related modules are os, os.path, and shutil.os. It is the most popular language among developers and programmers as it can be used in Machine Learning, Web Development, Image Processing, etc. The identifiers args and kwargs are a convention, you could also use *bob and **billy but that would not be wise. I think interviewer asked almost all basic things * Brief yourself * Explain OOPS Concept ? complex(real,imag) – This functionconverts real numbers to complex(real,imag) number. Palindrome in Python: How to check a number is palindrome? Python is a cross-platform language, i.e., a Python program written on a Windows system will also run on a Linux system with little or no modifications at all. Ans: In Python, the capitalize() method capitalizes the first letter of a string. This is done using a module named ‘pickle’, hence the name pickling. Feel free to share all your doubts with us on our Python Community and get them clarified today! If the string already consists of a capital letter at the beginning, then, it returns the original string. The negative index is also used to show the index to represent the string in correct order. This is where your project’s settings.py file comes in. The expression gets evaluated like if x