You are on page 1of 6

10/13/2020 TCS PA Python MCQs

Python Tutorials Home Python  Database Web Development  TCS Campus Placement  Follow
Udem

  

Home  MCQs  TCS PA Python MCQs

TCS PA Python MCQs Follow b


Get all latest conten
 Programmers Venue  12:43 PM to your

 TCS PA Python MCQs


Email Address

SUBSC
1. What gets printed
foo = {}
print type(foo)
<class ‘dict’>
Popula

TCS PA O
MCQs an
2. Type of error in ‘st’+1
Type error
TCS Proc
Question
3. Python supports regular expressions
True
TCS Proc
MCQs Qu
4. Like the else, the elif statement is optional.
True
5. What gets printed?
numberGames={}
numberGames[(1,2,3)]=8
numberGames[(4,2,1)]=10 Ta
numberGames[(1,2)]=12
sum=0 Basic Logical Programs

for k in numberGames: CAMPUS PLACEMENT


    sum+=numberGames[k]
Compiler Construction Pr
    print len(numberGames)+sum
33 Conceptual Questions

Data Analytics Programs

6.The readlines() method returns PLACEMENT MATERIALS

a list of lines TCS CAMPUS HIRING

TCS PA TCS Python

7. Suppose s is “\t\tWorld\n”, what is s.strip()?


World
Feature

8. Function can not have return statement TCS NQT


False

9. What is the di erence between a class and an object in python? TCS NQT
Question
Objects are created from class

TCS NQT
10. Raw_input() returns
Coding Q
String

This study source was downloaded by 100000796410834 from CourseHero.com on 01-20-2022 10:56:13 GMT -06:00

https://pythonvenue.blogspot.com/2020/05/tcs-pa-python-mcqs.html 1/6
https://www.coursehero.com/file/102655435/TCS-PA-Python-MCQspdf/
10/13/2020 TCS PA Python MCQs

11. Output of following code Total Pag


Follow
Si=’spamandeggs’
X=si. nd(‘and’) 132424

print(x)   
print(si[0:1],si[5:7])
4(‘s’,’nd’)

Follow b
12. Which method is used to delete an object created by initializing constructor.
Get all latest conten
Destructor to your

Email Address

13. To read two characters from a le object in le, we use


SUBSC
in le.read(2)

14. What would the statement “print('%.2f'%123.444)” Popula


123.44
TCS PA O
MCQs an
15. What can you put before and after a section to make all of the lines a comment?
'''
TCS Proc
Question
16. What gets printed ?
nums=set([1,1,2,3,3,3,4])
TCS Proc
print(len(nums))
MCQs Qu
4

17.Python programming can handle every error implicitly


True
Ta

18. Syntax error is also called as Basic Logical Programs

parsing error CAMPUS PLACEMENT

Compiler Construction Pr

19. Str1=’hello’ Conceptual Questions

Str2=’,’ Data Analytics Programs


Str3=’world’
PLACEMENT MATERIALS
Str1[-1:]
o TCS CAMPUS HIRING

TCS PA TCS Python

20. Str1=’helloworld’
Str1[::-1]
dlrowolleh Feature

TCS NQT

21. 2.0+2
4.0
TCS NQT
Question
22. E=’hello’ print E. nd(‘e’)
1

TCS NQT
23. What arithmetic operator can not be used with strings?
Coding Q
**,-

This study source was downloaded by 100000796410834 from CourseHero.com on 01-20-2022 10:56:13 GMT -06:00

https://pythonvenue.blogspot.com/2020/05/tcs-pa-python-mcqs.html 2/6
https://www.coursehero.com/file/102655435/TCS-PA-Python-MCQspdf/
10/13/2020 TCS PA Python MCQs

24. Foo={1:’1’,2:’2’,3:’3’}
Foo={} Total Pag
Follow
Print len(Foo) 
 0 132424
  
25. Print ‘new’’line’
newline

26. Python is not suited for fast and memory intensive tasks Follow b
Get all latest conten
ANS: True to your

Email Address

27. Enthought or rather EPD


SUBSC
Integrated development environment for python

28. Which of the following are immutable built-in types of python Popula
numbers,strings,tuples
TCS PA O
MCQs an
29. The format function returns: 
str
TCS Proc
Question

30. How much control statements python supports?


 3
TCS Proc
MCQs Qu

31. Print “abcd”[2:]


cd

32. def myfunc(x,y,z,a): Ta


print x+y
nums=[1,2,3,4] Basic Logical Programs

myfunc(*nums) CAMPUS PLACEMENT


3
Compiler Construction Pr

Conceptual Questions

Data Analytics Programs


33. example="snow world"
PLACEMENT MATERIALS
print "%s"%example[4:7]
wo TCS CAMPUS HIRING

TCS PA TCS Python

34. print str(1)+str(2)


12
Feature
35. Use of sys.stdout. ush() is
get that text on the screen quickly. TCS NQT

36. names=['Amir','Barry','Chales','Dao']
TCS NQT
print names[-1][-1]
Question
o

37. Suppose i is 5 and j is 4, i + j is same as


TCS NQT
i.__add__(j)
Coding Q

This study source was downloaded by 100000796410834 from CourseHero.com on 01-20-2022 10:56:13 GMT -06:00

https://pythonvenue.blogspot.com/2020/05/tcs-pa-python-mcqs.html 3/6
https://www.coursehero.com/file/102655435/TCS-PA-Python-MCQspdf/
10/13/2020 TCS PA Python MCQs

38. what will be the output of the below code snippet?


print({} is {}) Total Pag
Follow
1.True
2.no 132424

3.yes   
4.false

Follow b
39. Sets={3,4,5,6}
Get all latest conten
sets.update([1,2,3]) to your
print(sets)
what is the output from the above snippet? Email Address

1.{1,2,3,3,4,5,6}
SUBSC
2.{1,2,3,4,5,6}
3.{1,2,4,5,6}
4.{1,2,3,4,5}

Popula

TCS PA O
40. variable 'a' is de ned as MCQs an
a='gOOd moRning'
Select the statement which will convert the 'a' from 'gOOd moRning' to 'Good Morning'?
1.a.upper() TCS Proc
2.a.string() Question

3.a.title()
4.a.lower()
TCS Proc
MCQs Qu

41. Mylist=['a','a',b','b','b','c','c','d','e']
Mylist.index('b')What is the output of the above code?
1. 2
2.3 Ta
3.4
4.5 Basic Logical Programs

CAMPUS PLACEMENT

Compiler Construction Pr

42. what is the output of the below code? Conceptual Questions

s='Welcome$to$python' Data Analytics Programs


print(s.split('$'));
PLACEMENT MATERIALS
1.Welcometopython
2.Welcome to python TCS CAMPUS HIRING
3.['Welcome','to','python']
TCS PA TCS Python
4.'Welcome','to','python'

Feature
43. import math
print(math. oor(5.5)) TCS NQT
what is the output from the above code?
1.5.5
2.6
TCS NQT
3. 5
Question
4.0

TCS NQT
44.in the python the below statement represents X=a+5-b
Coding Q
1.alphabets

2.operands
This study source was downloaded by 100000796410834 from CourseHero.com on 01-20-2022 10:56:13 GMT -06:00

https://pythonvenue.blogspot.com/2020/05/tcs-pa-python-mcqs.html 4/6
https://www.coursehero.com/file/102655435/TCS-PA-Python-MCQspdf/
10/13/2020 TCS PA Python MCQs

3. None of these
4.Terms Total Pag
Follow
132424

45. in the below list   


Numbers=[1,2,3,4]
Numbers.append([5,6,7,8])
print(len(Numbers))
What is the output from the above snippet? Follow b
1. 5
Get all latest conten
2.12 to your
3.8
4.7 Email Address

SUBSC

46. What is the output of below python code Popula


a=('a','b','c','d','e','f','g','h')
x=slice(3,5) TCS PA O
print(a[x]) MCQs an
1.('d','f')
2. ('d','e')
3.('c','f') TCS Proc
4.('c','e') Question

TCS Proc
MCQs Qu

47. What is the output of below code


math.sqrt(36)
1. 6 Period 0
2.5
3.6 Ta
4.7
Basic Logical Programs

CAMPUS PLACEMENT

Compiler Construction Pr
48. What is the output of below python code?
s='TCS' Conceptual Questions

r_str=s[::-1] Data Analytics Programs


print(r_str)
PLACEMENT MATERIALS
1.TC
2. SCT TCS CAMPUS HIRING
3.TCS
TCS PA TCS Python
4.CS

Feature
49. my_tuple=(1,,5,3,9)
my_tuple.append((8,6,7)) TCS NQT
print(len(my_tuple))
what is the output from the above code?
1.An exception is thrown
TCS NQT
2.1
Question
3.2
4.5

TCS NQT
MCQs TCS OPA TCS PA
Coding Q

This study source was downloaded by 100000796410834 from CourseHero.com on 01-20-2022 10:56:13 GMT -06:00

https://pythonvenue.blogspot.com/2020/05/tcs-pa-python-mcqs.html 5/6
https://www.coursehero.com/file/102655435/TCS-PA-Python-MCQspdf/
10/13/2020 TCS PA Python MCQs

     
Total Pag
Follow
132424
 OLDER NEWER 
TCS OPA MCQs 15 MAY TCS PA Java MCQs
  

You may like these posts


Follow b
Get all latest conten
to your

Email Address

SUBSC
TCS PA Unix MCQs TCS PA PLSQL MCQs TCS PA RiO MCQs

Post a Comment Popula

0 Comments TCS PA O
MCQs an

Enter your comment...


TCS Proc
Question

TCS Proc
HOME CONTACT US MCQs Qu

Designed with  by Way2Themes | Distributed by Blogger

Ta

Basic Logical Programs

CAMPUS PLACEMENT

Compiler Construction Pr

Conceptual Questions

Data Analytics Programs

PLACEMENT MATERIALS

TCS CAMPUS HIRING

TCS PA TCS Python

Feature

TCS NQT

TCS NQT
Question

TCS NQT
Coding Q

This study source was downloaded by 100000796410834 from CourseHero.com on 01-20-2022 10:56:13 GMT -06:00

https://pythonvenue.blogspot.com/2020/05/tcs-pa-python-mcqs.html 6/6
https://www.coursehero.com/file/102655435/TCS-PA-Python-MCQspdf/
Powered by TCPDF (www.tcpdf.org)

You might also like