[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

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

3 / 40

3. Python can connect to database systems.

4 / 40

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

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. Which of the following is the correct extension of the Python file?

7 / 40

7. Comments starts with a #

8 / 40

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

9 / 40

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

10 / 40

10. Extension of all Python  Programme are .py

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. To write and execute code in python, we first need to install Python on our system

13 / 40

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

14 / 40

14.

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

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

15 / 40

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

16 / 40

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

17 / 40

17.

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

18 / 40

18.

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

19 / 40

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

20 / 40

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

21 / 40

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

22 / 40

22.

Which function overloads the >> operator?

  1. more()
  2. gt()
  3. ge()
  4. None of the above

23 / 40

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

24 / 40

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

25 / 40

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

26 / 40

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

27 / 40

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

28 / 40

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

29 / 40

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

30 / 40

30.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

31 / 40

31. A variable name cannot start with a number

32 / 40

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

33 / 40

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

34 / 40

34. Find and write the output of the following python code:

x = “abcdef”

i = “a”

while i in x:

print(i, end = ” “)

a) a

b) a a a a a a

c) a a a a a a … infinite times

d) Code will generate error

35 / 40

35. The list’s remove() method only removes the first occurrence of the specified value.

36 / 40

36. Python relies on indentation?

37 / 40

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

38 / 40

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

39 / 40

39.

What will be the output of above Python code?

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

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

40 / 40

40.

 Select the correct example of complex datatype in Python

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

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.