[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. Most recent major version of Python is Python 3

2 / 40

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

3 / 40

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

4 / 40

4. Who developed Python Programming Language?

5 / 40

5.

In Python, a variable may be assigned a value of one type, and then later assigned a value of a different type:

  1. False
  2. True

6 / 40

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

7 / 40

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

8 / 40

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

9 / 40

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

10 / 40

10.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

11 / 40

11.

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

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

12 / 40

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

13 / 40

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

14 / 40

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

15 / 40

15. Indentation refers to the spaces at the beginning of a code line.

16 / 40

16.

 Which of the following statement is False?

  1. Variable names can be arbitrarily long.
  2. They can contain both letters and numbers.
  3. Variable name can begin with underscore.
  4. Variable name can begin with number.

17 / 40

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

18 / 40

18.

 What is output of: 35 == 35.0

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

19 / 40

19.

What will be the output of below Python code?

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

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

20 / 40

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

21 / 40

21. The elif keyword is pythons way of saying “if the previous conditions were not true, then try this condition”.

22 / 40

22. Python can connect to database systems.

23 / 40

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

24 / 40

24. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

25 / 40

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

a) for

b) while

c) Both (a) and (b)

d) None of the above

26 / 40

26. Bitwise operators are used to compare (binary) numbers

27 / 40

27. Comparison operators are not  used to compare two values

28 / 40

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

29 / 40

29. The format() method takes the passed arguments

30 / 40

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

31 / 40

31.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

32 / 40

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

33 / 40

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

34 / 40

34. You can use three double quotes only:

a = “””Lorem ipsum dolor sit amet,
consectetur adipiscing elit,
sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua.”””
print(a)

35 / 40

35. Variable names are case-sensitive

36 / 40

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

37 / 40

37.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

38 / 40

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

39 / 40

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

40 / 40

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

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.