[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

2. Extension of all Python  Programme are .py

3 / 40

3. Variables that are created outside of a function

4 / 40

4. Most recent major version of Python is Python 3

5 / 40

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

6 / 40

6. A variable name must start with a letter or the underscore character

7 / 40

7. The for loop in Python is an _____________

a) Entry Controlled Loop

b) Exit Controlled Loop

c) Both of the above

d) None of the above

8 / 40

8. Python has various versions available

9 / 40

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

10 / 40

10. The else keyword catches anything which isn’t caught by the preceding conditions.

11 / 40

11. A variable name cannot start with a number

12 / 40

12.

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

13 / 40

13. Python can be install on both  Linux and  Windows

14 / 40

14. Which of the following is a Python tuple?
a) [1, 2, 3]
b) (1, 2, 3)
c) {1, 2, 3}
d) {}

15 / 40

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

16 / 40

16.

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

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

17 / 40

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

18 / 40

18.

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

19 / 40

19.

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

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

20 / 40

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

21 / 40

21. With the break statement we can stop the loop before it has looped through all the items

22 / 40

22.

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

23 / 40

23.

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

24 / 40

24.

 ____________________ 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

25 / 40

25.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

26 / 40

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

27 / 40

27. A for loop is used for iterating over a sequence (that is either a list, a tuple, a dictionary, a set, or a string).

28 / 40

28. Who developed Python Programming Language?

29 / 40

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

30 / 40

30.

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

a. [ ]

b. { }

c. ( )

d. None of the above

31 / 40

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

32 / 40

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

33 / 40

33. An array can hold many values under a single name

34 / 40

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

35 / 40

35. Comparison operators are not  used to compare two values

36 / 40

36.

Which is the correct operator for power(xy)?

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

37 / 40

37. Python relies on indentation?

38 / 40

38. Comments starts with a #

39 / 40

39. You can use the pop() method to remove an element from the array

40 / 40

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

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.