[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. Which of the following is the correct extension of the Python file?

2 / 40

2.

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

3 / 40

3.

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.

4 / 40

4.

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

a. 2

b. 3

c. 5

d. Multiple times

5 / 40

5. Comments can be used to explain Python code.

6 / 40

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

7 / 40

7.

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

a. Define

b. DEF

c. def

d. Def

8 / 40

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

9 / 40

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

10 / 40

10.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

11 / 40

11. Extension of all Python  Programme are .py

12 / 40

12. Python can be install on both  Linux and  Windows

13 / 40

13.

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.

14 / 40

14.

 ____________________ can be defined as a named group of instructions that accomplish a specific task when it is invoked/called.

a. Function

b. Datatype

c. Token

d. Operator

15 / 40

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

16 / 40

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

17 / 40

17. python has two primitive loop commands:

  • while loops
  • for loops

18 / 40

18. Python has syntax that allows developers to write programs with fewer lines than some other programming languages.

19 / 40

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

20 / 40

20. Official site of python is www.python.org

21 / 40

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

22 / 40

22.

 Select the correct example of complex datatype in Python

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

23 / 40

23. During Installation Make sure to select both the checkboxes at the bottom .

24 / 40

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

25 / 40

25. A variable name cannot start with a number

26 / 40

26. Comments starts with a #

27 / 40

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

28 / 40

28.

Which of the following statements assigns the value 25 to the variable x in Python:

  1. x ← 25
  2. x = 25
  3. x := 25
  4. int x = 25
  5. x << 25

29 / 40

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

30 / 40

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

31 / 40

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

32 / 40

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

33 / 40

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

34 / 40

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

a. 5

b. 3

c. 6

d. 7

35 / 40

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

36 / 40

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

37 / 40

37.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

38 / 40

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

39 / 40

39.

What do we use to define a block of code in Python language?

  1. Key
  2. Brackets
  3. Indentation
  4. None of these

40 / 40

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

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.