[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

2.

 ____________________ 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

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. Camel Case
Each word, except the first, starts with a capital letter:

5 / 40

5. We can combine strings and numbers by using the format() method

6 / 40

6. The for loop does not require an indexing variable to set beforehand

7 / 40

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

8 / 40

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

9 / 40

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

10 / 40

10.

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

a. Define

b. DEF

c. def

d. Def

11 / 40

11.

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

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.

 Which of the following statement is False?

  1. Variable names can be arbitrarily long.
  2. They can contain both letters and numbers.
  3. Variable name can begin with underscore.
  4. Variable name can begin with number.

14 / 40

14. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

15 / 40

15.

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.

16 / 40

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

17 / 40

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

18 / 40

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

a. 5

b. 3

c. 6

d. 7

19 / 40

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

20 / 40

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

21 / 40

21. Python can connect to database systems.

22 / 40

22.

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

23 / 40

23.

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

24 / 40

24.

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.

25 / 40

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

26 / 40

26.

What will be the output of above Python code?

str1="6/4"print("str1")

A. 1
B. 6/4
C. 1.5
D. str1

27 / 40

27.

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

28 / 40

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

29 / 40

29. Which of the following is the correct extension of the Python file?

30 / 40

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

31 / 40

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

32 / 40

32.

 Select the correct example of complex datatype in Python

  1. 3 + 2j
  2. -100j
  3. 5j
  4. All of the above are correct

33 / 40

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

34 / 40

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

35 / 40

35. Can we write if/else into one line in python?

a) Yes
b) No
c) if/else not used in python
d) None of the above

36 / 40

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

37 / 40

37.

What will be the output of below Python code?

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

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

38 / 40

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

39 / 40

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

40 / 40

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

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.