Monday 4 April 2022

Top 11 Python Interview Question and Answers for QA - SDET - Dev ? Must know concepts of python basics?

 


Automation Testing/SDET Framework Design Link

Java Related Interview Question Set LINK

GIT Interview Question Set LINK 

Python is one of the most important language to learn in present era, so to help you all below are the Top 11 Python Interview questions and answers for your interview preparation and guide to learn the crucial concepts.

Selenium Interview Questions and answers

Java Coding Interview Questions and Answers

GIT Interview Questions and Answers


If you are preparing for Selenium-Python Interview then also check below Q&A:


Python Interview Question & Answers Set - 01

Python Interview Q&A Set - 02

Python Interview Q&A Set - 03

1. What is Identation in Python?

Ans: Indentation is defined as the no. of white spaces that are used to define a specific area or block or region and this is a convention in python.


2. How many white spaces for the main function region of python?

Ans:  Four white spaces to define the main function’s region or block which is called indentation and it’s usually four. This is one of the main differences between other languages and python.

3. What are the python frameworks you have used for Test Automation?

Ans:
 - Robot
- Pytest
- Test Project

To learn more about the Robot framework, refer the link: Robot Framework

4. Tell me some of the comments types you have used in your code?

There are two types of comments:

  1. Single-Line Comments
    Single line comments start with “#” for example : # This is a single line comment in Python

  2. Multi-line Comments
    If you put anything inside a multiline string(triple quotes) anywhere in your code then that will be called multiline comments, for example:

    print("Example of multiline comments")

    """This is

        a multiline

        comment in python

    """

5. What will be output of below code:

x = 20  

x = "test"

print(x)

Ans: test


6. What re the rules of variable naming in python?

Ans: Click Here For All The Rules


7. What is the use of type() in python?


Ans: Python uses “type()” to determine the type of any datatype, see the example below–

Example

x = 2

y = “test”

z = [“test”, 1]

print(type(x))

print(type(y))

print(type(z))


Output

<class 'int'>

<class 'str'>

<class 'list'>


8. How to convert an integer to string in python ? How to perform typecasting?


Ans:
var = 23

varString = str(var). //convert the int datatype to string


9. What is complex datatype in Python?


Ans: In Python, “complex numbers” are created using “j” after a number.


Example

x = 12 + 5j

y= 2j


10. Let we have below string, we want to print only Automation


x = "TestAutomation"


Ans: print(mystr[4:len(mystr)])


11. How to define multiple variables with single line in python?


Ans: Click Here For Answer



Check below link for question and answers with code:

Top API Interview Question 1-10

*************************************************

SeleniumWebdriver Automation Testing Interview Questions:

API Testing Interview Question Set:
https://automationreinvented.blogspot.com/search/label/Rest-API

 
Kubernetes Interview Question Set
https://automationreinvented.blogspot.com/search/label/Kubernetes

 
Docker Interview Question Set
https://automationreinvented.blogspot.com/2020/02/top-18-docker-commands-for-aytomation.html

 
Linux Interview question Set
https://automationreinvented.blogspot.com/search/label/Linux

 
Automation Testing/SDET Framework Design
https://automationreinvented.blogspot.com/search/label/FrameworkDesign


Java Related Interview Question Set

https://automationreinvented.blogspot.com/search/label/Java


GIT Interview Question Set:
https://automationreinvented.blogspot.com/search/label/GIT


Coding Interview Question Set:
https://automationreinvented.blogspot.com/search/label/Coding%20Questions
Mobile Testing Interview Question Set:
https://automationreinvented.blogspot.com/search/label/Mobile%20Testing
Python Interview Question Set for QAE - SDET - SDE:
https://automationreinvented.blogspot.com/search/label/Python




No comments:

Post a Comment

All Time Popular Posts

Most Featured Post

API Status Codes with examples for QA-Testers

  🔺 LinkedIn: https://www.linkedin.com/in/sidharth-shukla-77b53145/ 🔺 Telegram Group:  https://t.me/+FTf_NPb--GQ2ODhl 🏮In API testing, it...