[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

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

3 / 40

3.

 What is output of: 35 == 35.0

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

4 / 40

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

5 / 40

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

6 / 40

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

7 / 40

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

8 / 40

8.

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.

9 / 40

9. Extension of all Python  Programme are .py

10 / 40

10.

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

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

11 / 40

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

12 / 40

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

13 / 40

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

14 / 40

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

15 / 40

15.

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

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. You have to use the same number of spaces in the same block of code, otherwise Python will give you an error

18 / 40

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

19 / 40

19. Find the output of the following program segments:

for i in range(20,30,2):

print(i)

a) 20 22 24 26 28

b) 20

22

24

26

28

c) 20 22 24 26 28 30

d) 20

22

24

26

28

30

20 / 40

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

21 / 40

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

22 / 40

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

23 / 40

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

24 / 40

24.

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

25 / 40

25. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

26 / 40

26. With the break statement we can stop the loop before it has looped through all the items

27 / 40

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

28 / 40

28.

Which of the following precedence order is correct in Python?

  1. Parentheses, Exponential, Multiplication, Division, Addition, Subtraction
  2. Multiplication, Division, Addition, Subtraction, Parentheses, Exponential
  3. Division, Multiplication, Addition, Subtraction, Parentheses, Exponential
  4. Exponential, Parentheses, Multiplication, Division, Addition, Subtraction

29 / 40

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

30 / 40

30.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

31 / 40

31. 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()

 

32 / 40

32. The len() method to return the length of an array

33 / 40

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

34 / 40

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

35 / 40

35. Find the output of the given Python program?

a = 25if a < 15:    print("Hi")if a <= 30:    print("Hello")else:    print("Know Program")

a) Hi
b) Hello
c) Know Program
d) Compiled Successfully, No Output.

36 / 40

36. Most recent major version of Python is Python 3

37 / 40

37.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

38 / 40

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

39 / 40

39.

 Select the correct example of complex datatype in Python

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

40 / 40

40.

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.

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.