[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

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

2 / 40

2.

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

a. Define

b. DEF

c. def

d. Def

3 / 40

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

4 / 40

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

5 / 40

5. You can also have multiple else statements on the same line:

6 / 40

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

7 / 40

7. You can also have an else without the elif

8 / 40

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

9 / 40

9. Variable names are case-sensitive

10 / 40

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

11 / 40

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

12 / 40

12. The length of an array is always one more than the highest array index.

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

15 / 40

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

16 / 40

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

17 / 40

17. Arrays are used to store multiple values in one single variable.

18 / 40

18.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

19 / 40

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

20 / 40

20. Which of the following character is used to give single-line comments in Python?
a) //
b) #
c) !
d) /*

21 / 40

21.

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

22 / 40

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

23 / 40

23.

The function can be called in the program by writing function name followed by ____

a. [ ]

b. { }

c. ( )

d. None of the above

24 / 40

24.

 What is output of: 35 == 35.0

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

25 / 40

25. Python can be install on both  Linux and  Windows

26 / 40

26.

 Select the correct example of complex datatype in Python

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

27 / 40

27.

Which function overloads the >> operator?

  1. more()
  2. gt()
  3. ge()
  4. None of the above

28 / 40

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

29 / 40

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

30 / 40

30.

In the Python statement x = a + 5 – b:

a and b are ________a + 5 - b is ________
  1. terms, a group
  2. operators, a statement
  3. operands, an expression
  4. operands, an equation

31 / 40

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

32 / 40

32. Indentation refers to the spaces at the beginning of a code line.

33 / 40

33.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

34 / 40

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

35 / 40

35. An array is a special variable, which can hold more than one value at a time

36 / 40

36. What keyword would you use to add an alternative condition to an if statement?

a) else if
b) elseif
c) elif
d) None of the above

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. An example of an illegal character is a double quote inside a string that is surrounded by double quotes

39 / 40

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

40 / 40

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

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.