[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

2. An example of an illegal character is a double quote inside a string that is surrounded by double quotes

3 / 40

3.

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

a. 2

b. 3

c. 5

d. Multiple times

4 / 40

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

5 / 40

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

6 / 40

6. Comments can be used to explain Python code.

7 / 40

7. Variable names are case-sensitive

8 / 40

8. Is there any comments in  following codes

i = 1while True:    if i%3 == 0:        break    print(i)     i + = 1

 

9 / 40

9.

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

10 / 40

10.

What will be the output of below Python code?

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

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

11 / 40

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

a. 5

b. 3

c. 6

d. 7

12 / 40

12.

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

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

13 / 40

13. What keyword would you use to add an alternative condition to an if statement?

a) else if
b) elseif
c) elif
d) None of the above

14 / 40

14.

What will the below Python code will return?

If str1="save paper,save plants"str1.find("save")

A. It returns the first index position of the first occurance of “save” in the given string str1.
B. It returns the last index position of the last occurance of “save” in the given string str1.
C. It returns the last index position of the first occurance of “save” in the given string str1.
D. It returns the first index position of the first occurance of “save” in the given string str1.

15 / 40

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

16 / 40

16.

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

17 / 40

17. Most recent major version of Python is Python 3

18 / 40

18.

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

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

19 / 40

19.

 ____________________ 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

20 / 40

20. Python is an interpreted programming language

21 / 40

21. A variable name cannot start with a number

22 / 40

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

23 / 40

23.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

24 / 40

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

25 / 40

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

26 / 40

26. Extension of all Python  Programme are .py

27 / 40

27. Python will give you an error if you skip the indentation

28 / 40

28.

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

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

29 / 40

29. python file can also run on command line

30 / 40

30. python has two primitive loop commands:

  • while loops
  • for loops

31 / 40

31.

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

a. [ ]

b. { }

c. ( )

d. None of the above

32 / 40

32.

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

33 / 40

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

34 / 40

34. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

35 / 40

35. Python relies on indentation?

36 / 40

36.

Write the output of the following code :

str = "Welcome"str[2] = 'a'print(str)

a. Weacome

b. Error

c. aWelcome

d. Welcomea

37 / 40

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

38 / 40

38. Python can be treated in a procedural way, an object-oriented way or a functional way.

39 / 40

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

40 / 40

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

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.