0% found this document useful (0 votes)
2 views

Python questions

Uploaded by

Rathees P G
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Python questions

Uploaded by

Rathees P G
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

####################Protocol Testing#########################

1.Swapping of two numbers without using temp ?


2.Write a program for Palindrome
3.Remove duplicate elements in a list and print including duplicate also
4.To find a cube root in function method
5.In a log file
/var/log/syslog/
27oct---

6.We want to grep with date=27oct &module=test.py in function method,and output is


expected as filter('27oct','test.py')-->['my-message-0','my-message-1'...'my-
message-5']
7.In a string want to print reverselly with a words(not in chars)
8.In a given sring want to identify only digits(numbers)
9.write a program for dictionary and can segricate the values based on data types
10.write a program to convert dictionary in to a list
11.write a program for at a time multiple routers reload
12.what is use of lambda function
13.In a paragraph want to grep first qp chars if space is ended need to print with
previous chars
14.In my system ram size is 2gb,but file size is 2TB,how to read through the file
handling?
15.In a linux want to login and execute ifconfig and need to grep ip 1.1.1.1 is
assigned in any of interface ?
16.In a string want to print mac address alone?
17.In a program shall we use else in while and for loop?
18.In a given list want to print second largest number ?
19.In a list want to delete by "elements(values)" directly?
20.What is generator and decorator
21.List =[0,1,2,...100]
Print two different list , one with only even number and other with only odd
numbers

22.In a given list list1=[1,2,3,'all','bob',foo',4] Print numbers in one list and


strings in another list.
23.Difference between set and list.

1.)Write a program using lib file and follow teamplate setup,test and teardown.
2.)Try/Except clause. How to do handle all exceptions. what is meant by user
defined exception ?
3.)Write the above program using class
4.)What is class, what is object, use of main function
5.)What is use of self in class
6.)Dictionary advantages and disadvantages (which one replace dictionary)
7.)Reverse the word --- "DHANABAL IS MY NAME" (Reverse it)
8.)What is meant by static/class variable
9.)What is meant by class members/class methods/static method/instance method
10.)what is difference between list and tuple
11.)a = (1,2,3). Add last element to tuple. Add elements in between tuple.
12.)what is meant by lambda ? whatis filter,map,reduce ? write programs for
filter,map,reduce
13.)list comprehension, dictionary comprehension --- complete
14.)Memory management in python
15.)How to append dictionary to another dictionary ?
16.)What is meant by encapsulation ? what is meant by abstract class ?
17.)Inheritance --- complete, what is meant by mutiple inheritance ? what is MRO ?
18.)Polymorphism --- Method overriding, Method overloading, operator overloading
--- complete
19.)Write a program --- list with hundreds of strings ("Suman_Raju_Ramu",....)
where we should remove underscore and make trailing letter captialize for all
strings using decorator and pass the output to another function.
20.)write a program to sort the list based on surname
21.)*args and **kwargs
22.)use of zip command in python
23.)encapsulation in python
24.)Abstract class in python
25.)how to call same method (2 methods with same name in single class) ?
26.)reverse list using logics (using for loop and range function)
27.)write a program to select unmatched numbers in 2 different lists
28.)shallow copy and deep copy
29.)GIT commands
30.)what is meant by smoke testing ?
31.)Linux commands to find file, search process, kill process
32.)Regex commands in python
33.)grep ip address using python
34.)write fibonaci program in python
35.)what is recuersive function ?
36.)what is iterator and generator --- complete
37.)what is magic methods ? --- complete
38.)use of __init__ and main() functions in python
39.)use of tuple() in real time
40.)use of static methods and class methods real time
41.)find even number without using modulus operator
42.)is operator and in operator in python
43.)how to login into device (ssh function) ?
44.)what are the files available in datastore for virtual machines ?
45.)what is the size of vmdk files ?
46.)what is meant by VMDK files ?
47.)singly linked list, how to reverse singly linked list , how to remove middle
node in linked list ?
48.)find subset of string
49.)find out the second largest number in the list
50.)remove trailing zeros from the string
51.)difference between sort(),sorted(). Difference between reverse() and reversed()
functions
52.)regex to search uppercase in string
53.)regex to find interface details in the string
54.)write a program to where input is (abc$%d) and output should be (dcb$%a) using
classmethod
55.)write a program to create meeting
56.)what is golden regression testing
57.)How to get proper number in python ?
58.)Use of __init__.py file in python
59.)how python will know the

You might also like