[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

2 / 40

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

3 / 40

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

4 / 40

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

5 / 40

5.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

6 / 40

6. Who developed Python Programming Language?

7 / 40

7. Find and write the output of the following python code:

x = “abcdef”

i = “a”

while i in x:

print(i, end = ” “)

a) a

b) a a a a a a

c) a a a a a a … infinite times

d) Code will generate error

8 / 40

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

9 / 40

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

10 / 40

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

11 / 40

11.

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

12 / 40

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

13 / 40

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

14 / 40

14.

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

15 / 40

15.

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

16 / 40

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

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. Variable names are case-sensitive

19 / 40

19.

What will be the output of below Python code?

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

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

20 / 40

20.

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

21 / 40

21.

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

a. 2

b. 3

c. 5

d. Multiple times

22 / 40

22. Official site of python is www.python.org

23 / 40

23.

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

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

24 / 40

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

25 / 40

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

26 / 40

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

27 / 40

27. All keywords in Python are in _________
a) Capitalized
b) lower case
c) UPPER CASE
d) None of the mentioned

28 / 40

28.

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

29 / 40

29.

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

30 / 40

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

31 / 40

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

32 / 40

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

33 / 40

33. Python has various versions available

34 / 40

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

35 / 40

35.

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

a. Define

b. DEF

c. def

d. Def

36 / 40

36. Extension of all Python  Programme are .py

37 / 40

37. Python allows you to extract the values into variables.

38 / 40

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

39 / 40

39.

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

40 / 40

40. + operator is used  to get output of multiple variables

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.