[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

2. Python can be used on a server to create web applications?

3 / 40

3.

How to copy one list to another in python?

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

4 / 40

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

5 / 40

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

6 / 40

6. Comments starts with a #

7 / 40

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

8 / 40

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

9 / 40

9.

Which is the correct operator for power(xy)?

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

10 / 40

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

a. 5

b. 3

c. 6

d. 7

11 / 40

11. Camel Case
Each word, except the first, starts with a capital letter:

12 / 40

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

13 / 40

13. Comparison operators are not  used to compare two values

14 / 40

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

15 / 40

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

16 / 40

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

17 / 40

17. Who developed Python Programming Language?

18 / 40

18. What will be the output of the following Python code?

i = 1while True:    if i%3 == 0:        break    print(i)     i + = 1

a) 1 2
b) 1 2 3
c) error
d) none of the mentioned

19 / 40

19. The format() method takes unlimited number of arguments

20 / 40

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

21 / 40

21.

The function can be called in the program by writing function name followed by ____

a. [ ]

b. { }

c. ( )

d. None of the above

22 / 40

22.

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

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

23 / 40

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

24 / 40

24.

What is the value of the expression 100 / 25?

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

25 / 40

25.

What will be the output of below Python code?

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

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

26 / 40

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

27 / 40

27.

In a program, a function can be called ____________ times.

a. 2

b. 3

c. 5

d. Multiple times

28 / 40

28.

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

29 / 40

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

30 / 40

30.

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.

31 / 40

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

32 / 40

32. Strings in python are surrounded by either single quotation marks, or double quotation marks

33 / 40

33. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

34 / 40

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

a) for

b) while

c) Both (a) and (b)

d) None of the above

35 / 40

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

36 / 40

36. Which of the following is a Python tuple?
a) [1, 2, 3]
b) (1, 2, 3)
c) {1, 2, 3}
d) {}

37 / 40

37.

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

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

38 / 40

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

39 / 40

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

40 / 40

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

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.