[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

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

3 / 40

3.

What is the data type of print(type(0xFF))

4 / 40

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

5 / 40

5.

What will be the output of below Python code?

str1="Information"print(str1[2:8])

A. format
B. formatio
C. orma
D. ormat

6 / 40

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

7 / 40

7.

 Select the correct example of complex datatype in Python

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

8 / 40

8. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

9 / 40

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

10 / 40

10.

Which one of the following is the correct extension of the Python file?

  1. .py
  2. .python
  3. .p
  4. None of these

11 / 40

11. Python can be used to handle big data and perform complex mathematics.

12 / 40

12. You can have if statements inside if statements, this is called nested if statements.

13 / 40

13. Extension of all Python  Programme are .py

14 / 40

14. Python relies on indentation?

15 / 40

15. The for loop does not require an indexing variable to set beforehand

16 / 40

16.

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.

17 / 40

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

18 / 40

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

19 / 40

19.

What will be the output of above Python code?

str1="6/4"print("str1")

A. 1
B. 6/4
C. 1.5
D. str1

20 / 40

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

21 / 40

21. A for loop is used for iterating over a sequence (that is either a list, a tuple, a dictionary, a set, or a string).

22 / 40

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

23 / 40

23.

What is the value of the expression 100 / 25?

  1. 4
  2. 4.0
  3. 0
  4. 25

24 / 40

24. Python is an interpreted programming language

25 / 40

25. With the for loop we can execute a set of statements

26 / 40

26. What is the output of the given below program?

if 1 + 3 == 7:    print("Hello")else:    print("Know Program")

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

27 / 40

27.

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

a. True

b. False

28 / 40

28. 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))

29 / 40

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

30 / 40

30.

In the Python statement x = a + 5 – b:

a and b are ________a + 5 - b is ________
  1. terms, a group
  2. operators, a statement
  3. operands, an expression
  4. operands, an equation

31 / 40

31. if statements cannot be empty, but if you for some reason have an if statement with no content, put in the pass statement to avoid getting an error

32 / 40

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

33 / 40

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

34 / 40

34. A variable name cannot start with a number

35 / 40

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

36 / 40

36. Which of the following character is used to give single-line comments in Python?
a) //
b) #
c) !
d) /*

37 / 40

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

38 / 40

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

39 / 40

39.

Write the output of the following code :

str = "Welcome"str[2] = 'a'print(str)

a. Weacome

b. Error

c. aWelcome

d. Welcomea

40 / 40

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

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.