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

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

3 / 40

3. A variable name can only contain alpha-numeric characters and
underscores

4 / 40

4.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

5 / 40

5.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

6 / 40

6.

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

a. 2

b. 3

c. 5

d. Multiple times

7 / 40

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

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. You can use the append() method to add an element to an array

10 / 40

10. Variables that are created outside of a function

11 / 40

11.

Which is the correct operator for power(xy)?

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

12 / 40

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

13 / 40

13.

 What is output of: 35 == 35.0

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

14 / 40

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

15 / 40

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

16 / 40

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

17 / 40

17.

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

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

18 / 40

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

19 / 40

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

20 / 40

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

21 / 40

21. Python will give you an error if you skip the indentation

22 / 40

22.

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

a. True

b. False

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

26 / 40

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

27 / 40

27. You can also have an else without the elif

28 / 40

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

29 / 40

29.

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

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

30 / 40

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

31 / 40

31. Extension of all Python  Programme are .py

32 / 40

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

33 / 40

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

34 / 40

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

35 / 40

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

36 / 40

36.

Function defined to achieve some task as per the programmer’s requirement is called a ___________

a. user defined function

b. library function

c. built in functions

d. All of the above.

37 / 40

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

38 / 40

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

39 / 40

39.

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

40 / 40

40.

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

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.