[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

2 / 40

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

3 / 40

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

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

a) Hi
b) Know Program

c)
Hi
Hello

d)
Know Program
Hello

4 / 40

4.

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.

5 / 40

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

6 / 40

6. python has two primitive loop commands:

  • while loops
  • for loops

7 / 40

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

8 / 40

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

9 / 40

9.

How to copy one list to another in python?

A. l1[] = l2[]
B. l1[] = l2
C. l1[] = l2[:]
D. l1 = l2

10 / 40

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

11 / 40

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

12 / 40

12. To write and execute code in python, we first need to install Python on our system

13 / 40

13. Python is an interpreted programming language

14 / 40

14.

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.

15 / 40

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

16 / 40

16.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

17 / 40

17.

Which is the correct operator for power(xy)?

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

18 / 40

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

19 / 40

19. Who developed Python Programming Language?

20 / 40

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

21 / 40

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

22 / 40

22. The format() method takes the passed arguments

23 / 40

23. Which keyword is used for function?
a) Fun
b) Define
c) Def
d) Function

24 / 40

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

25 / 40

25. Comments starts with a #

26 / 40

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

27 / 40

27.

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

28 / 40

28.

The most important object defined in NumPy is an N-dimensional array type called?

A. ndarray
B. narray
C. nd_array
D. darray

29 / 40

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

30 / 40

30. A variable name can only contain alpha-numeric characters and
underscores

31 / 40

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

32 / 40

32.

What is the value of the expression 100 / 25?

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

33 / 40

33. print() function is often used to output variables.

34 / 40

34.

What is the data type of print(type(10))

35 / 40

35. Python can connect to database systems.

36 / 40

36. Variable names are case-sensitive

37 / 40

37. An example of an illegal character is a double quote inside a string that is surrounded by double quotes

38 / 40

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

39 / 40

39.

Which keyword is used to begin the definition of a function?

a. Define

b. DEF

c. def

d. Def

40 / 40

40.

Function defined to achieve some task as per the programmer’s requirement is called a ___________

a. user defined function

b. library function

c. built in functions

d. All of the above.

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.