[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 is used to define a block of code in Python language?
a) Indentation
b) Key
c) Brackets
d) All of the mentioned

2 / 40

2. Which of the following is False regarding loops in Python?

a)Loops are used to perform certain tasks repeatedly.

b) while loop is used when multiple statements are to executed repeatedly until the given condition becomes true.

c) while loop is used when multiple statements are to executed repeatedly until the given condition becomes false.

d) for loop can be used to iterate through the elements of lists.

3 / 40

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

4 / 40

4. The format() method takes the passed arguments

5 / 40

5. Python is a  high-level programming language.

6 / 40

6.

l = [ 4, 8, 9, 2.6, 5 ] is a type of which data type in python?

  1. List
  2. Tuple
  3. Set
  4. None of these

7 / 40

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

8 / 40

8. if statements cannot be empty, but if you for some reason have an if statement with no content, put in the pass statement to avoid getting an error

9 / 40

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

10 / 40

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

11 / 40

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

12 / 40

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

13 / 40

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

14 / 40

14.

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

15 / 40

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

16 / 40

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

a. 5

b. 3

c. 6

d. 7

17 / 40

17.

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

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

18 / 40

18.

What will be the output of below Python code?

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

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

19 / 40

19. Python can be install on both  Linux and  Windows

20 / 40

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

21 / 40

21. Extension of all Python  Programme are .py

22 / 40

22.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

23 / 40

23. python file can also run on command line

24 / 40

24. Python can connect to database systems.

25 / 40

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

26 / 40

26.

Which is the correct operator for power(xy)?

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

27 / 40

27.

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

28 / 40

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

29 / 40

29.

 ____________________ 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

30 / 40

30.

How to copy one list to another in python?

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

31 / 40

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

32 / 40

32. Comments can be used to make the code more readable.

33 / 40

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

34 / 40

34.

What will be the output of above Python code?

str1="6/4"print("str1")

A. 1
B. 6/4
C. 1.5
D. str1

35 / 40

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

36 / 40

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

37 / 40

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

a) for

b) while

c) Both (a) and (b)

d) None of the above

38 / 40

38. Python is an interpreted programming language

39 / 40

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

40 / 40

40.

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

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.