[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. 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.

2 / 40

2. Snake Case
Each word is separated by an underscore character:

3 / 40

3. break in Python is used ______________

a) To restart a loop

b) Terminate a loop

c) To jump in between the loop

d) None of the above

4 / 40

4. Most recent major version of Python is Python 3

5 / 40

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

a. 5

b. 3

c. 6

d. 7

6 / 40

6. Python will give you an error if you skip the indentation

7 / 40

7. Python has syntax that allows developers to write programs with fewer lines than some other programming languages.

8 / 40

8. You can also have an else without the elif

9 / 40

9. 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

10 / 40

10. Python can be treated in a procedural way, an object-oriented way or a functional way.

11 / 40

11.

What will the below Python code will return?

If str1="save paper,save plants"str1.find("save")

A. It returns the first index position of the first occurance of “save” in the given string str1.
B. It returns the last index position of the last occurance of “save” in the given string str1.
C. It returns the last index position of the first occurance of “save” in the given string str1.
D. It returns the first index position of the first occurance of “save” in the given string str1.

12 / 40

12. The else keyword catches anything which isn’t caught by the preceding conditions.

13 / 40

13.

Which of the following precedence order is correct in Python?

  1. Parentheses, Exponential, Multiplication, Division, Addition, Subtraction
  2. Multiplication, Division, Addition, Subtraction, Parentheses, Exponential
  3. Division, Multiplication, Addition, Subtraction, Parentheses, Exponential
  4. Exponential, Parentheses, Multiplication, Division, Addition, Subtraction

14 / 40

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

15 / 40

15. Which of the following loop is not supported by the python programming language?

a) for loop

b) while loop

c) do…while loop

d) None of the above

16 / 40

16. We can combine strings and numbers by using the format() method

17 / 40

17. 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

18 / 40

18.

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

a. True

b. False

19 / 40

19. Python is a  high-level programming language.

20 / 40

20.

 What is output of: 35 == 35.0

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

21 / 40

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

22 / 40

22.

 ____________________ can be defined as a named group of instructions that accomplish a specific task when it is invoked/called.

a. Function

b. Datatype

c. Token

d. Operator

23 / 40

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

24 / 40

24. Identity operators are used to compare the objects, not if they are equal, but if they are actually the same object, with the same memory location

25 / 40

25. A variable name cannot start with a number

26 / 40

26. To insert characters that are illegal in a string, use an escape character

27 / 40

27. You have to use the same number of spaces in the same block of code, otherwise Python will give you an error

28 / 40

28. Comments starts with a #

29 / 40

29. Operators are used to perform operations on variables and values

30 / 40

30. Can we write if/else into one line in python?

a) Yes
b) No
c) if/else not used in python
d) None of the above

31 / 40

31.

l = [ 4, 8, 9, 2.6, 5 ] is a type of which data type in python?

  1. List
  2. Tuple
  3. Set
  4. None of these

32 / 40

32.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

33 / 40

33. Comments can’t be used to prevent execution when testing code.

34 / 40

34.

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.

35 / 40

35.

Choose the correct option with respect to Python.

A. Both tuples and lists are immutable.
B. Tuples are immutable while lists are mutable.
C. Both tuples and lists are mutable.
D. Tuples are mutable while lists are immutable.

36 / 40

36. Suppose t = (1, 2, 4, 3), which of the following is incorrect?
a) print(t[3])
b) t[3] = 45
c) print(max(t))
d) print(len(t))

37 / 40

37. During Installation Make sure to select both the checkboxes at the bottom .

38 / 40

38. When does the else statement written after loop executes?

a) When loop condition becomes false

b) When break statement is executed in the loop

c) else statement is always executed

d) None of the above

39 / 40

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

40 / 40

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

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.