TOP PYTHON INTERVIEW QUESTIONS FOR FRESHERS 2020
VonGTec Vesu
Dieses E-Book entspricht möglicherweise nicht den Standards zur Barrierefreiheit und ist eventuell nicht vollständig mit unterstützenden Technologien kompatibel.
TOP PYTHON INTERVIEW QUESTIONS FOR FRESHERS 2020
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.
Top Python Basic Interview Questions and Answers 2020
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: https://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 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.
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.
For more questions, visit https://gtecvesu.com/python-interview-questions-for-freshers/
Details
- Veröffentlicht am
- Oct 12, 2020
- Sprache
- English
- Kategorie
- Computer & Internet
- Copyright
- Alle Rechte vorbehalten - Standard-Urheberrechtslizenz
- Autoren/Mitwirkende
- Von (Autor): GTec Vesu
Spezifikationen
- Format