JOBSEEKERS
Login
Sign Up
Jobseeker
Employer
Staffing Firm
Direct Client
Python interview questions part 54
Python interview questions part 54
Back
Take as many assements as you can to improve your validate your skill rating
Total Questions: 20
1. What is the output of the following? print('{:,}'.format(1112223334))
A. 1112223334
B. 111,222,333,4
C. 1112223334
D. Error
Show Correct Answer
Correct Answer is :
1112223334
2. What is the output of the following? print('{:,}'.format('1112223334'))
A. 1112223334
B. 111,222,333,4
C. 1112223334
D. Error
Show Correct Answer
Correct Answer is :
Error
3. What is the output of the following? print('{:$}'.format(1112223334))
A. 1112223334
B. 111,222,333,4
C. 1112223334
D. Error
Show Correct Answer
Correct Answer is :
Error
4. What is the output of the following? print('{:#}'.format(1112223334))
A. 1112223334
B. 111,222,333,4
C. 1112223334
D. Error
Show Correct Answer
Correct Answer is :
1112223334
5. What is the output of the following? print('{0:.2}'.format(1/3))
A. 0.333333
B. 0.33
C. 0.333333:.2
D. Error
Show Correct Answer
Correct Answer is :
0.33
6. What is the output of the following? print('{0:.2%}'.format(1/3))
A. 0.33
B. 0.0033
C. 0.3333
D. 0.33
Show Correct Answer
Correct Answer is :
0.3333
7. What is the output of the following? print('ab12'.isalnum())
A. TRUE
B. FALSE
C. None
D. Error
Show Correct Answer
Correct Answer is :
TRUE
8. What is the output of the following? print('ab,12'.isalnum())
A. TRUE
B. FALSE
C. None
D. Error
Show Correct Answer
Correct Answer is :
FALSE
9. What is the output of the following? print('ab'.isalpha())
A. TRUE
B. FALSE
C. None
D. Error
Show Correct Answer
Correct Answer is :
TRUE
10. What is the output of the following? print('a B'.isalpha())
A. TRUE
B. FALSE
C. None
D. Error
Show Correct Answer
Correct Answer is :
FALSE
11. What is the output of the following? print('0xa'.isdigit())
A. TRUE
B. FALSE
C. None
D. Error
Show Correct Answer
Correct Answer is :
FALSE
12. What is the output of the following? print(''.isdigit())
A. TRUE
B. FALSE
C. None
D. Error
Show Correct Answer
Correct Answer is :
FALSE
13. What is the output of the following? print('my_string'.isidentifier())
A. TRUE
B. FALSE
C. None
D. Error
Show Correct Answer
Correct Answer is :
TRUE
14. What is the output of the following? print('__foo__'.isidentifier())
A. TRUE
B. FALSE
C. None
D. Error
Show Correct Answer
Correct Answer is :
TRUE
15. Which of the following functions can help us to find the version of python that we are currently working on?
A. sys.version
B. sys.version()
C. sys.version(0)
D. sys.version(1)
Show Correct Answer
Correct Answer is :
sys.version
16. Which of the following functions is not defined under the sys module?
A. sys.platform
B. sys.path
C. sys.readline
D. sys.argv
Show Correct Answer
Correct Answer is :
sys.readline
17. The output of the functions len(“abc”) and sys.getsizeof(“abc”) will be the same. State whether true or false.
A. TRUE
B. FALSE
C.
D.
Show Correct Answer
Correct Answer is :
FALSE
18. What is the output of the code shown below, if the code is run on Windows operating system? import sys if sys.platform[:2]== 'wi': print("Hello")
A. Error
B. Hello
C. No output
D. Junk value
Show Correct Answer
Correct Answer is :
Hello
19. What is the output of the following line of code, if the sys module has already been imported? sys.stdout.write("hello world")
A. helloworld
B. hello world10
C. hello world11
D. error
Show Correct Answer
Correct Answer is :
hello world11
20. What is the output of the code shown below? import sys sys.stdin.readline() Sanfoundry
A. ‘Sanfoundry\n’
B. ‘Sanfoundry’
C. ‘Sanfoundry10’
D. Error
Show Correct Answer
Correct Answer is :
‘Sanfoundry\n’
Similar Interview Questions
Search for latest jobs
Find Jobs