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

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.

3 / 40

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

4 / 40

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

5 / 40

5. X wants to allow the program to repeatedly ask the user to enter their Choice if it does not equal the Answer. Which loop option should X use?

a) while Choice == Answer:

Choice = input()

b) while Choice != Answer:

Choice = input()

c) while Answer != Choice:

Choice = input()

d) while Answer =! Choice:

Choice = input()

 

6 / 40

6.

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

7 / 40

7.

Which is the correct operator for power(xy)?

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

8 / 40

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

  1. d = {"john":40, "peter":45}
  2. d["john"]

a) 40
b) 45
c) “john”
d) “peter”

9 / 40

9.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

10 / 40

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

11 / 40

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

12 / 40

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

13 / 40

13. Which term describes a loop that continues repeating without a terminating (ending) condition?

a) Infinite Loop

b) Conditional Loop

c) Unlimited Loop

d) Sequence Loop

14 / 40

14. Operators are used to perform operations on variables and values

15 / 40

15.

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.

16 / 40

16.

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

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

17 / 40

17. A variable name cannot start with a number

18 / 40

18.

 Select the correct example of complex datatype in Python

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

19 / 40

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

20 / 40

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

a) for

b) while

c) Both (a) and (b)

d) None of the above

21 / 40

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

22 / 40

22. Python is a  high-level programming language.

23 / 40

23.

 What is output of: 35 == 35.0

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

24 / 40

24. The format() method takes the passed arguments

25 / 40

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

26 / 40

26. Comments starts with a #

27 / 40

27. You can have if statements inside if statements, this is called nested if statements.

28 / 40

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

29 / 40

29. Extension of all Python  Programme are .py

30 / 40

30. A variable name must start with a letter or the underscore character

31 / 40

31.

What is the data type of print(type(10))

32 / 40

32.

What will be the output of below Python code?

tupl=([2,3],"abc",0,9)tupl[0][1]=1print(tupl)A. ([2,3],"abc",0,9)B. ([1,3],"abc",0,9)C. ([2,1],"abc",0,9)D. Error

33 / 40

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

34 / 40

34.

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

35 / 40

35.

Which of the following is not a keyword in Python language?

  1. val
  2. raise
  3. try
  4. with

36 / 40

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

37 / 40

37. Comments can be used to explain Python code.

38 / 40

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

39 / 40

39.

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

a. Define

b. DEF

c. def

d. Def

40 / 40

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

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.