[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. Is there any comments in  following codes

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

 

2 / 40

2. The format() method takes the passed arguments

3 / 40

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

4 / 40

4. You can also use the remove() method to remove an element from the array

5 / 40

5. A variable name cannot start with a number

6 / 40

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

7 / 40

7. print() function is often used to output variables.

8 / 40

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

9 / 40

9. What does the following code print?

x = -10if x < 0:    print("The negative number ",  x, " is not valid here.")print("This is always printed")
a.This is always printedb.The negative number -10 is not valid hereThis is always printedc.The negative number -10 is not valid here

10 / 40

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

11 / 40

11.

Which statement is correct?

A. List is immutable && Tuple is mutable
B. List is mutable && Tuple is immutable
C. Both are Mutable.
D. Both are Immutable

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. You can also have multiple else statements on the same line:

14 / 40

14. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

15 / 40

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

16 / 40

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

17 / 40

17. What will be the output of the following Python code?

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

a) 1 2
b) 1 2 3
c) error
d) none of the mentioned

18 / 40

18.

 ____________________ 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

19 / 40

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

20 / 40

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

21 / 40

21. Python has various versions available

22 / 40

22. The list’s remove() method only removes the first occurrence of the specified value.

23 / 40

23. Python  was created by Guido van Rossum, and released in 1999.

24 / 40

24. Camel Case
Each word, except the first, starts with a capital letter:

25 / 40

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

26 / 40

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

a. 5

b. 3

c. 6

d. 7

27 / 40

27.

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

28 / 40

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

29 / 40

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

30 / 40

30. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

31 / 40

31.

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

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. We can combine strings and numbers by using the format() method

34 / 40

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

35 / 40

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

36 / 40

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

37 / 40

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

38 / 40

38.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

39 / 40

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

40 / 40

40.

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

a. 2

b. 3

c. 5

d. Multiple times

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.