[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. The format() method takes the passed arguments

2 / 40

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

3 / 40

3.

Which is the correct operator for power(xy)?

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

4 / 40

4. You can also have multiple else statements on the same line:

5 / 40

5. Python can be used on a server to create web applications?

6 / 40

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

7 / 40

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

8 / 40

8. Comments starts with a #

9 / 40

9.

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

10 / 40

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

11 / 40

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

12 / 40

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

13 / 40

13.

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

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

14 / 40

14. A variable name cannot start with a number

15 / 40

15.

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

16 / 40

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

17 / 40

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

18 / 40

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

19 / 40

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

20 / 40

20. You can also have an else without the elif

21 / 40

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

22 / 40

22.

What will be the output of below Python code?

str1="Information"print(str1[2:8])

A. format
B. formatio
C. orma
D. ormat

23 / 40

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

24 / 40

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

25 / 40

25. Extension of all Python  Programme are .py

26 / 40

26.

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

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

27 / 40

27.

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

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

28 / 40

28. Is there any comments in  following codes

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

 

29 / 40

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

30 / 40

30. Variable names are case-sensitive

31 / 40

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

32 / 40

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

33 / 40

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

34 / 40

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

35 / 40

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

36 / 40

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

37 / 40

37. Identity operators are used to compare the objects, not if they are equal, but if they are actually the same object, with the same memory location

38 / 40

38.

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.

39 / 40

39.

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

40 / 40

40.

Which of the following is False?

A. String is immutable.
B. capitalize() function in string is used to return a string by converting the whole given string into uppercase.
C. lower() function in string is used to return a string by converting the whole given string into lowercase.
D. None of these.

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.