Practice Exam 7
Practice Exam 7
A. #I am a comment
B. //I am a comment
C. // I am a comment in python //
D. comment(I am a comment in python)
A. Anthony hopkins
B. Guido van Rossum
C. James Gosling
D. Yukihiro Matsumoto
A. _ak = "forrest"
B. 123abc = "forrest"
C. _myvar= "forrest"
D. my_var= "forrest"
A. Only numbers
B. Only strings
C. All kind of arguments
D. print() function doesn't support arguments
A. Syntax Error
B. {'Name', 'age', 3}
C. {'Robert', 30, [2,3,4,5,8]}
D. {'Name': 'Robert', 'age': 30, 3: [2, 3, 4, 5, 8]}
A. 1,4,7,
B. syntax error
C. 1,2,4,5,6,7,8,9,10
D. 1,10,3
10. Which of the following the correct output to the mentioned below code?
print("apple","mangoes","Bananas","Oranges","Watermelon")
A. "apple","mangoes","Bananas","Oranges","Watermelon"
B. apple mangoes Bananas oranges
C. apple mangoes Bananas Oranges Watermelon
D. None of the above
A. Compiled language
B. Assembled language
C. Interpreted language
D. None of the above
A. bottle-cup-bag-wallet-sep
B. bottle, cup, bag, wallet
C. bottle cup bag wallet
D. bottle-cup-bag-wallet
A. 3
B. 3.5
C. 4
D. Syntax Error
15. Which one is the correct file extension used for python files ?
A. .ty
B. .pyt
C. .py
D. .pt
A. different values
B. Same values
C. syntax error
D. runtime error
A. Robert
B. ['Robert', '']
C. ["Robert","Karamagi"]
D. ["Robert"]
A. 6
B. 2
C. 1
D. 4.0
A. army::castle
B. army:castle:
C. castle::army
D. none of the above
A. body is ok
B. fever is detected
C. Emergency, Rush to the hospital
D. No data is entered
A. 2
B. 3
C. Syntax Error
D. none of the above
A. TypeError
B. TRUE
C. FALSE
D. UnboundLocalError
A. 1.2.3.4.5.6.7.8.9.10.11.12
B. 1 3 5 7 9 11
C. 1,3,5,7,9,11,
D. None of the above
27. What will the output be after running the following code?
def magicTrick(num) :
if (num % 2 == 0):
print('even')
else:
print("odd")
magicTrick(8)
A. even
B. odd
C. magicTrick
D. num
A. FALSE
B. TRUE
C. error
D. undefined variable
29. Which of the following will convert the string "hello, life is beautiful" to
"Hello, Life Is Beautiful"
A. capitalize()
B. uppercase()
C. bigcase()
D. upper()
A. True
B. False
C. Maybe
D. So