1. What gets printed
foo = {}
print type(foo)
ANS: <class ‘dict’>
2. Type of error in ‘st’+1
ANS: Type error
3. Python supports regular expressions
ANS: True
4. Like the else, the elif statement is optional.
ANS: True
5. What gets printed?
numberGames={}
numberGames[(1,2,3)]=8
numberGames[(4,2,1)]=10
numberGames[(1,2)]=12 sum=0
for k in numberGames:
sum+=numberGames[k]
print len(numberGames)+sum
ANS: 33
6. The readlines() method returns
ANS: a list of lines
7. Suppose s is “\t\tWorld\n”, what is s.strip()?
ANS: World
8. Function can not have return statement
ANS: False
9. What is the difference between a class and an object in python?
ANS: Objects are created from class
10. Raw_input() returns
ANS: String
11. Output of following code
Si=’spamandeggs’
X=si.find(‘and’)
Print(x)
Print(si[0:1],si[5:7])
ANS: 4(‘s’,’nd’)
12. Which method is used to delete an object created by initializing constructor.
ANS: Destructor
13. To read two characters from a file object infile, we use
ANS: infile.read(2)
14. What would the statement “print('%.2f'%123.444)”
ANS: 123.44
15. What can you put before and after a section to make all of the lines a comment?
ANS: ‘’’
16. What gets printed ?
nums=set([1,1,2,3,3,3,4])
Print len(nums)
ANS: 4
17. Python programming can handle every error implicitly
ANS: True
18. Syntax error is also called as
ANS: parsing error
19. Str1=’hello’
Str2=’,’
Str3=’world’
Str1[-1:]
ANS: o
20. Str1=’helloworld’
Str1[::-1]
ANS: dlrowolleh
21. 2.0+2
ANS: 4.0
22. E=’hello’ print E.find(‘e’)
ANS: 1
23. What arithmetic operator can not be used with strings?
ANS: **,-
24. Foo={1:’1’,2:’2’,3:’3’}
Foo={}
Print len(Foo)
ANS: 0
25. Print ‘new’’line’
ANS: newline
26. Python is not suited for fast and memory intensive tasks
ANS: True
27. Enthought or rather EPD
ANS: Integrated development environment for python
28. Which of the following are immutable built-in types of python
ANS: numbers,strings,tuples
29. The format function returns:
ANS: str
30. How much control statements python supports?
ANS: 3
31. Print “abcd”[2:]
ANS: cd
32. def myfunc(x,y,z,a):
print x+y
nums=[1,2,3,4]
myfunc(*nums)
ANS: 3
33. example="snow world"
print "%s"%example[4:7]
ANS: wo
34. print str(1)+str(2)
ANS: 12
35. IndentError is not python built-in exception
36. Use of sys.stdout.flush() is
ANS: get that text on the screen quickly.
37. names=['Amir','Barry','Chales','Dao']
print names[-1][-1]
ANS:o
38. Suppose i is 5 and j is 4, i + j is same as
ANS: i.__add__(j)
foo = {}
print type(foo)
ANS: <class ‘dict’>
2. Type of error in ‘st’+1
ANS: Type error
3. Python supports regular expressions
ANS: True
4. Like the else, the elif statement is optional.
ANS: True
5. What gets printed?
numberGames={}
numberGames[(1,2,3)]=8
numberGames[(4,2,1)]=10
numberGames[(1,2)]=12 sum=0
for k in numberGames:
sum+=numberGames[k]
print len(numberGames)+sum
ANS: 33
6. The readlines() method returns
ANS: a list of lines
7. Suppose s is “\t\tWorld\n”, what is s.strip()?
ANS: World
8. Function can not have return statement
ANS: False
9. What is the difference between a class and an object in python?
ANS: Objects are created from class
10. Raw_input() returns
ANS: String
11. Output of following code
Si=’spamandeggs’
X=si.find(‘and’)
Print(x)
Print(si[0:1],si[5:7])
ANS: 4(‘s’,’nd’)
12. Which method is used to delete an object created by initializing constructor.
ANS: Destructor
13. To read two characters from a file object infile, we use
ANS: infile.read(2)
14. What would the statement “print('%.2f'%123.444)”
ANS: 123.44
15. What can you put before and after a section to make all of the lines a comment?
ANS: ‘’’
16. What gets printed ?
nums=set([1,1,2,3,3,3,4])
Print len(nums)
ANS: 4
17. Python programming can handle every error implicitly
ANS: True
18. Syntax error is also called as
ANS: parsing error
19. Str1=’hello’
Str2=’,’
Str3=’world’
Str1[-1:]
ANS: o
20. Str1=’helloworld’
Str1[::-1]
ANS: dlrowolleh
21. 2.0+2
ANS: 4.0
22. E=’hello’ print E.find(‘e’)
ANS: 1
23. What arithmetic operator can not be used with strings?
ANS: **,-
24. Foo={1:’1’,2:’2’,3:’3’}
Foo={}
Print len(Foo)
ANS: 0
25. Print ‘new’’line’
ANS: newline
26. Python is not suited for fast and memory intensive tasks
ANS: True
27. Enthought or rather EPD
ANS: Integrated development environment for python
28. Which of the following are immutable built-in types of python
ANS: numbers,strings,tuples
29. The format function returns:
ANS: str
30. How much control statements python supports?
ANS: 3
31. Print “abcd”[2:]
ANS: cd
32. def myfunc(x,y,z,a):
print x+y
nums=[1,2,3,4]
myfunc(*nums)
ANS: 3
33. example="snow world"
print "%s"%example[4:7]
ANS: wo
34. print str(1)+str(2)
ANS: 12
35. IndentError is not python built-in exception
36. Use of sys.stdout.flush() is
ANS: get that text on the screen quickly.
37. names=['Amir','Barry','Chales','Dao']
print names[-1][-1]
ANS:o
38. Suppose i is 5 and j is 4, i + j is same as
ANS: i.__add__(j)
This information you provided in the blog that is really unique I love it!! Thanks for sharing such a great blog. Keep posting..
ReplyDeletePython training
Python Course
Python training institute
thanks for sharing please keep it up.
ReplyDeletePython Training in Gurgaon
thanks for sharing such an amazing information... Keep posting
ReplyDeleteNice blog, Thank you for sharing such a wonderful information. Best Python Online Training || Learn Python Course
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteNice blog.Thank you
ReplyDeletePython training in Mumbai
Nice Blog...
ReplyDeletePython Training in Bangalore
Best AI Training in Bangalore
Machine Learning Training in Bangalore
Superb. I really enjoyed very much with this article here. Really it is an amazing article I had ever read. I hope it will help a lot for all.
ReplyDeletePython Training
Python course
Such an interesting and informative piece of guidance imparted by you. I am glad to discover this information here and I am sure that this might be beneficial for us.
ReplyDeleteWeb delopment company in India
Nice blog Content.It is very informative and helpful. Please share more content. Thanks.
ReplyDeleteVmware Training in Gurgaon
Vmware Course in Gurgaon
Vmware Training institute in Gurgaon
Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging
ReplyDeletePython Training in electronic city
Good Post. I like your blog. Thanks for Sharing..................!
ReplyDeletePython Course in Noida
Great Post, I hope really gather more information for me.
ReplyDeletePython Online Training
Python Online Training in Chennai
Python Online Course in Chennai
This is information is better good luckpython course
ReplyDeleteThanks for such a wonderful content. Our Motive is not just to create links but to get them indexed as will
ReplyDeleteIncrease Domain Authority (DA).We’re on a mission to increase DA PA of your domain
High Quality Backlink Building Service
Boost DA upto 15+ at cheapest
Boost DA upto 25+ at cheapest . Very Helpful
Ensure you are registered for this course and enjoy the advantages of the Machine Learning Training in Hyderabad at AI Patasala.
ReplyDeleteOnline Machine Learning Training in Hyderabad
Sign up today for the intensive Python Course in Hyderabad program taught by experienced trainers from AI Patasala.
ReplyDeletePython Course Hyderabad
This comment has been removed by the author.
ReplyDeleteWonderful post. Connect with us for Python Training
ReplyDeleteFirm
ReplyDelete