[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. The for loop in Python is an _____________

a) Entry Controlled Loop

b) Exit Controlled Loop

c) Both of the above

d) None of the above

2 / 40

2. Comments can be used to explain Python code.

3 / 40

3. Comments can be used to make the code more readable.

4 / 40

4.

Which is the correct operator for power(xy)?

  1. X^y
  2. X**y
  3. X^^y
  4. None of the mentioned

5 / 40

5. With the break statement we can stop the loop even if the while condition is true

6 / 40

6.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

7 / 40

7. You can also have an else without the elif

8 / 40

8. What keyword would you use to add an alternative condition to an if statement?

a) else if
b) elseif
c) elif
d) None of the above

9 / 40

9. Find the output of the given Python program?

a = 25if a < 15:    print("Hi")if a <= 30:    print("Hello")else:    print("Know Program")

a) Hi
b) Hello
c) Know Program
d) Compiled Successfully, No Output.

10 / 40

10. With the break statement we can stop the loop before it has looped through all the items

11 / 40

11. What is the index value of ‘i’ in string “Learning”

a. 5

b. 3

c. 6

d. 7

12 / 40

12. Is Python code compiled or interpreted?
a) Python code is both compiled and interpreted
b) Python code is neither compiled nor interpreted
c) Python code is only compiled
d) Python code is only interpreted

13 / 40

13. You can also have multiple else statements on the same line:

14 / 40

14.

 What is output of: 35 == 35.0

  1. False
  2. True
  3. 33
  4. None of the above

15 / 40

15. Which of the following is used to define a block of code in Python language?
a) Indentation
b) Key
c) Brackets
d) All of the mentioned

16 / 40

16. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

17 / 40

17. An array is a special variable, which can hold more than one value at a time

18 / 40

18. Arithmetic operators are used with numeric values to perform common mathematical operations

19 / 40

19.

Python considered the character enclosed in triple quotes as String.(T/F)

a. True

b. False

20 / 40

20. All keywords in Python are in _________
a) Capitalized
b) lower case
c) UPPER CASE
d) None of the mentioned

21 / 40

21.

What will be the output of below Python code?

str1="poWer"str1.upper()print(str1)

A. POWER
B. Power
C. power
D. poWer

22 / 40

22.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

23 / 40

23. What does the following code print?

x = -10if x < 0:    print("The negative number ",  x, " is not valid here.")print("This is always printed")
a.This is always printedb.The negative number -10 is not valid hereThis is always printedc.The negative number -10 is not valid here

24 / 40

24. Variable names are case-sensitive

25 / 40

25. Python is an interpreted programming language

26 / 40

26. Python is a  high-level programming language.

27 / 40

27. Bitwise operators are used to compare (binary) numbers

28 / 40

28. Python has a set of built-in methods that you can use on lists/arrays

29 / 40

29. Python allows you to extract the values into variables.

30 / 40

30. The length of an array is always one more than the highest array index.

31 / 40

31. You can also use the remove() method to remove an element from the array

32 / 40

32.

Which of the following is False?

A. String is immutable.
B. capitalize() function in string is used to return a string by converting the whole given string into uppercase.
C. lower() function in string is used to return a string by converting the whole given string into lowercase.
D. None of these.

33 / 40

33. Official site of python is www.python.org

34 / 40

34. Python can connect to database systems.

35 / 40

35. You can return a range of characters by using the slice syntax

36 / 40

36. Find the output of the following program segments:

for i in range(20,30,2):

print(i)

a) 20 22 24 26 28

b) 20

22

24

26

28

c) 20 22 24 26 28 30

d) 20

22

24

26

28

30

37 / 40

37.

 Select the correct example of complex datatype in Python

  1. 3 + 2j
  2. -100j
  3. 5j
  4. All of the above are correct

38 / 40

38. Which of the following is the use of function in python?
a) Functions are reusable pieces of programs
b) Functions don’t provide better modularity for your application
c) you can’t also create your own functions
d) All of the mentioned

39 / 40

39. Which of the following is False regarding loops in Python?

a)Loops are used to perform certain tasks repeatedly.

b) while loop is used when multiple statements are to executed repeatedly until the given condition becomes true.

c) while loop is used when multiple statements are to executed repeatedly until the given condition becomes false.

d) for loop can be used to iterate through the elements of lists.

40 / 40

40. Find and write the output of the following python code:

x = “abcdef”

i = “a”

while i in x:

print(i, end = ” “)

a) a

b) a a a a a a

c) a a a a a a … infinite times

d) Code will generate error

Exit



[hurrytimer id=”2250″]
[wooct_product]

Wrong shortcode initialized


You must log in to see your results.



Wrong shortcode initialized


There are no questions atteched yet.





[ays_quiz_leaderboard id=”Your_Quiz_ID” from=”Y-m-d H:i:sa” to=”Y-m-d H:i:s”]

Category:


Wrong shortcode initialized


[WATU 1]

You must log in to see your results.