[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

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

2 / 40

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

3 / 40

3. Python can be used to handle big data and perform complex mathematics.

4 / 40

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

5 / 40

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

a) for

b) while

c) Both (a) and (b)

d) None of the above

6 / 40

6.

Which is the correct operator for power(xy)?

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

7 / 40

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

8 / 40

8.

What will be the output of below Python code?

str1="poWer"str1.upper()print(str1)

A. POWER
B. Power
C. power
D. poWer

9 / 40

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

10 / 40

10.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

11 / 40

11.

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

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

12 / 40

12.

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

13 / 40

13. python file can also run on command line

14 / 40

14. Comments can be used to explain Python code.

15 / 40

15. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

16 / 40

16. Variable names are case-sensitive

17 / 40

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

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

20 / 40

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

21 / 40

21.

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

22 / 40

22.

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

23 / 40

23.

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

24 / 40

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

25 / 40

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

26 / 40

26. What is the index value of ‘i’ in string “Learning”

a. 5

b. 3

c. 6

d. 7

27 / 40

27. You can also have an else without the elif

28 / 40

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

29 / 40

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

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. Operators are used to perform operations on variables and values

32 / 40

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

33 / 40

33. The format() method takes the passed arguments

34 / 40

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

35 / 40

35.

 What is output of: 35 == 35.0

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

36 / 40

36. Comments starts with a #

37 / 40

37.

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

a. Define

b. DEF

c. def

d. Def

38 / 40

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

39 / 40

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

40 / 40

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

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.