[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

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

3 / 40

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

4 / 40

4. All keywords in Python are in _________
a) Capitalized
b) lower case
c) UPPER CASE
d) None of the mentioned

5 / 40

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

6 / 40

6.

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

7 / 40

7.

 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.

8 / 40

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

9 / 40

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

10 / 40

10.

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

11 / 40

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

12 / 40

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

13 / 40

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

14 / 40

14. Pascal Case
Each word starts with a capital letter:

15 / 40

15. Extension of all Python  Programme are .py

16 / 40

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

17 / 40

17. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

18 / 40

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

x = ['ab', 'cd']for i in x:    i.upper()print(x)

a) [‘ab’, ‘cd’]
b) [‘AB’, ‘CD’]
c) [None, None]
d) none of the mentioned

19 / 40

19.

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

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

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. You can use the append() method to add an element to an array

22 / 40

22.

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

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

23 / 40

23.

What is the value of the expression 100 / 25?

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

24 / 40

24.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

25 / 40

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

26 / 40

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

27 / 40

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

28 / 40

28.

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

29 / 40

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

a) for

b) while

c) Both (a) and (b)

d) None of the above

30 / 40

30. python file can also run on command line

31 / 40

31.

What will be the output of above Python code?

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

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

32 / 40

32.

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

33 / 40

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

34 / 40

34. Variables that are created outside of a function

35 / 40

35. Arithmetic operators are used with numeric values to perform common mathematical operations

36 / 40

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

37 / 40

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

38 / 40

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

39 / 40

39.

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.

40 / 40

40. Comparison operators are not  used to compare two values

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.