[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. An array can hold many values under a single name

2 / 40

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

3 / 40

3.

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

4 / 40

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

5 / 40

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

6 / 40

6.

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

7 / 40

7. Is there any comments in  following codes

i = 1while True:    if i%3 == 0:        break    print(i)     i + = 1

 

8 / 40

8.

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

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

9 / 40

9. Comments can be used to make the code more readable.

10 / 40

10. Python has various versions available

11 / 40

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

12 / 40

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

13 / 40

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

14 / 40

14. Extension of all Python  Programme are .py

15 / 40

15. Comments can be used to explain Python code.

16 / 40

16. You can also have an else without the elif

17 / 40

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

18 / 40

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

19 / 40

19.

Which of the following statement will execute in last?

def s(n1): #Statement 1      print(n1) #Statement 2n2=4 #Statement 3s(n2) #Statement 4

a. Statement 1

b. Statement 2

c. Statement 3

d. Statement 4

20 / 40

20.

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.

21 / 40

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

22 / 40

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

23 / 40

23.

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

a. 2

b. 3

c. 5

d. Multiple times

24 / 40

24.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

25 / 40

25. python file can also run on command line

26 / 40

26. Python relies on indentation?

27 / 40

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

28 / 40

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

29 / 40

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

30 / 40

30. Comments starts with a #

31 / 40

31.

How to copy one list to another in python?

A. l1[] = l2[]
B. l1[] = l2
C. l1[] = l2[:]
D. l1 = l2

32 / 40

32.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

33 / 40

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

34 / 40

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

35 / 40

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

36 / 40

36. Find the output of the given Python program?

a, b, c = 1, 3, 5if a > 0:  if b < 2:    print("Hi")  elif c > 3:    print("Hello")else:  print("Know Program")

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

37 / 40

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

 

38 / 40

38. What does the following code print?

x = -10if x < 0:    print("The negative number ",  x, " is not valid here.")print("This is always printed")
a.This is always printedb.The negative number -10 is not valid hereThis is always printedc.The negative number -10 is not valid here

39 / 40

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

40 / 40

40.

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

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

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.