[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

How to copy one list to another in python?

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

2 / 40

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

3 / 40

3.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

4 / 40

4. Python has a set of built-in methods that you can use on lists/arrays

5 / 40

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

6 / 40

6. Can we write if/else into one line in python?

a) Yes
b) No
c) if/else not used in python
d) None of the above

7 / 40

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

8 / 40

8. When does the else statement written after loop executes?

a) When loop condition becomes false

b) When break statement is executed in the loop

c) else statement is always executed

d) None of the above

9 / 40

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

10 / 40

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

a) for

b) while

c) Both (a) and (b)

d) None of the above

11 / 40

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

12 / 40

12.

 What is output of: 35 == 35.0

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

13 / 40

13. break in Python is used ______________

a) To restart a loop

b) Terminate a loop

c) To jump in between the loop

d) None of the above

14 / 40

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

15 / 40

15. Python is a  high-level programming language.

16 / 40

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

17 / 40

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

18 / 40

18. Extension of all Python  Programme are .py

19 / 40

19.

Which is the correct operator for power(xy)?

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

20 / 40

20.

Which of the following creates a tuple?

A. tuple1=(“a”,”b”)
B. tuple1[2]=(“a”,”b”)
C. tuple1=(5)*2
D. None of the above

21 / 40

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

22 / 40

22.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

23 / 40

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

24 / 40

24. Python can be install on both  Linux and  Windows

25 / 40

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

26 / 40

26.

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

a. 2

b. 3

c. 5

d. Multiple times

27 / 40

27. python file can also run on command line

28 / 40

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

29 / 40

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

30 / 40

30.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

31 / 40

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

32 / 40

32.

Python considered the character enclosed in triple quotes as String.(T/F)

a. True

b. False

33 / 40

33. Variables that are created outside of a function

34 / 40

34. Strings in python are surrounded by either single quotation marks, or double quotation marks

35 / 40

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

36 / 40

36.

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

37 / 40

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

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

a) 1 2
b) 1 2 3
c) error
d) none of the mentioned

38 / 40

38. Comments starts with a #

39 / 40

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

40 / 40

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

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.