[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

2 / 40

2.

Which statement is correct?

A. List is immutable && Tuple is mutable
B. List is mutable && Tuple is immutable
C. Both are Mutable.
D. Both are Immutable

3 / 40

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

4 / 40

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

5 / 40

5.

How to copy one list to another in python?

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

6 / 40

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

7 / 40

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

8 / 40

8.

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

9 / 40

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

10 / 40

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

11 / 40

11.

What is the value of the expression 100 / 25?

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

12 / 40

12.

 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.

13 / 40

13. Python is an interpreted programming language

14 / 40

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

15 / 40

15. Comparison operators are not  used to compare two values

16 / 40

16. The format() method takes unlimited number of arguments

17 / 40

17.

 ____________________ can be defined as a named group of instructions that accomplish a specific task when it is invoked/called.

a. Function

b. Datatype

c. Token

d. Operator

18 / 40

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

19 / 40

19.

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

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 keyword is used to begin the definition of a function?

a. Define

b. DEF

c. def

d. Def

22 / 40

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

23 / 40

23.

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

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

24 / 40

24.

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

a. True

b. False

25 / 40

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

26 / 40

26. The for loop does not require an indexing variable to set beforehand

27 / 40

27.

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

28 / 40

28. A variable name cannot start with a number

29 / 40

29. Arithmetic operators are used with numeric values to perform common mathematical operations

30 / 40

30. Python relies on indentation?

31 / 40

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

32 / 40

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

33 / 40

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

34 / 40

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

35 / 40

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

36 / 40

36. You can use three double quotes only:

a = “””Lorem ipsum dolor sit amet,
consectetur adipiscing elit,
sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua.”””
print(a)

37 / 40

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

38 / 40

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

39 / 40

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

40 / 40

40. Bitwise operators are used to compare (binary) numbers

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.