[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

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

a. 5

b. 3

c. 6

d. 7

3 / 40

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

4 / 40

4.

What will be the output of below Python code?

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

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

5 / 40

5. Operators are used to perform operations on variables and values

6 / 40

6.

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

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

7 / 40

7.

What is the value of the expression 100 / 25?

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

8 / 40

8. Suppose t = (1, 2, 4, 3), which of the following is incorrect?
a) print(t[3])
b) t[3] = 45
c) print(max(t))
d) print(len(t))

9 / 40

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

10 / 40

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

11 / 40

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

12 / 40

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

13 / 40

13.

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

a. [ ]

b. { }

c. ( )

d. None of the above

14 / 40

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

15 / 40

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

16 / 40

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

17 / 40

17.

The most important object defined in NumPy is an N-dimensional array type called?

A. ndarray
B. narray
C. nd_array
D. darray

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.

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

20 / 40

20.

In a program, a function can be called ____________ times.

a. 2

b. 3

c. 5

d. Multiple times

21 / 40

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

22 / 40

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

23 / 40

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

24 / 40

24.

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

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

25 / 40

25. Extension of all Python  Programme are .py

26 / 40

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

27 / 40

27. Find the output of the given Python program?

a = 25if a < 15:    print("Hi")if a <= 30:    print("Hello")else:    print("Know Program")

a) Hi
b) Hello
c) Know Program
d) Compiled Successfully, No Output.

28 / 40

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

29 / 40

29.

Which is the correct operator for power(xy)?

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

30 / 40

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

31 / 40

31. Strings in python are surrounded by either single quotation marks, or double quotation marks

32 / 40

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

33 / 40

33. The format() method takes the passed arguments

34 / 40

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

35 / 40

35.

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

36 / 40

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

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

39 / 40

39. Python is an interpreted programming language

40 / 40

40.

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

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.