[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. Comments starts with a #

2 / 40

2. Pip is  not a powerful package management system for Python software packages

3 / 40

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

4 / 40

4.

 What is output of: 35 == 35.0

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

5 / 40

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

6 / 40

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

7 / 40

7.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

8 / 40

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

9 / 40

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

10 / 40

10. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

11 / 40

11.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

12 / 40

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

13 / 40

13. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

14 / 40

14. Python  was created by Guido van Rossum, and released in 1999.

15 / 40

15. Python can connect to database systems.

16 / 40

16. You can use the pop() method to remove an element from the array

17 / 40

17.

What will be the output of below Python code?

tupl=([2,3],"abc",0,9)tupl[0][1]=1print(tupl)A. ([2,3],"abc",0,9)B. ([1,3],"abc",0,9)C. ([2,1],"abc",0,9)D. Error

18 / 40

18.

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

19 / 40

19. You can also have an else without the elif

20 / 40

20.

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.

21 / 40

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

22 / 40

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

23 / 40

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

24 / 40

24.

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

a. True

b. False

25 / 40

25. Arrays are used to store multiple values in one single variable.

26 / 40

26.

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.

27 / 40

27. You can use the append() method to add an element to an array

28 / 40

28. Comments can be used to explain Python code.

29 / 40

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

30 / 40

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

31 / 40

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

32 / 40

32.  ________ in Python is a counter-controlled loop.

a) for

b) while

c) Both (a) and (b)

d) None of the above

33 / 40

33. The len() method to return the length of an array

34 / 40

34. A variable name cannot start with a number

35 / 40

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

36 / 40

36. + operator is used  to get output of multiple variables

37 / 40

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

38 / 40

38. Python is a  high-level programming language.

39 / 40

39.

Which statement is correct?

A. List is immutable && Tuple is mutable
B. List is mutable && Tuple is immutable
C. Both are Mutable.
D. Both are Immutable

40 / 40

40. Python is an interpreted programming language

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.