[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

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

2 / 40

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

3 / 40

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

4 / 40

4. All keywords in Python are in _________
a) Capitalized
b) lower case
c) UPPER CASE
d) None of the mentioned

5 / 40

5.

What is the value of the expression 100 / 25?

  1. 4
  2. 4.0
  3. 0
  4. 25

6 / 40

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

7 / 40

7.

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

8 / 40

8.

 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.

9 / 40

9. You can return a range of characters by using the slice syntax

10 / 40

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

11 / 40

11.

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

a. Define

b. DEF

c. def

d. Def

12 / 40

12.

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.

13 / 40

13. Comparison operators are not  used to compare two values

14 / 40

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

15 / 40

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

16 / 40

16. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

17 / 40

17. Python can connect to database systems.

18 / 40

18.

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

19 / 40

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

20 / 40

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

21 / 40

21.

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

a. [ ]

b. { }

c. ( )

d. None of the above

22 / 40

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

23 / 40

23. Variables that are created outside of a function

24 / 40

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

25 / 40

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

26 / 40

26. Comments can’t be used to prevent execution when testing code.

27 / 40

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

28 / 40

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

29 / 40

29. Which term describes a loop that continues repeating without a terminating (ending) condition?

a) Infinite Loop

b) Conditional Loop

c) Unlimited Loop

d) Sequence Loop

30 / 40

30. Pascal Case
Each word starts with a capital letter:

31 / 40

31. You have to use the same number of spaces in the same block of code, otherwise Python will give you an error

32 / 40

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

33 / 40

33.

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

34 / 40

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

35 / 40

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

36 / 40

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

37 / 40

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

38 / 40

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

39 / 40

39. Python can be used on a server to create web applications?

40 / 40

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

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.