[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

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

3 / 40

3. Pip is  not a powerful package management system for Python software packages

4 / 40

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

5 / 40

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

6 / 40

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

7 / 40

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

8 / 40

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

9 / 40

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

10 / 40

10.  ________ in Python is a counter-controlled loop.

a) for

b) while

c) Both (a) and (b)

d) None of the above

11 / 40

11.

Function defined to achieve some task as per the programmer’s requirement is called a ___________

a. user defined function

b. library function

c. built in functions

d. All of the above.

12 / 40

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

  1. d = {"john":40, "peter":45}
  2. d["john"]

a) 40
b) 45
c) “john”
d) “peter”

13 / 40

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

14 / 40

14. Comments starts with a #

15 / 40

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

a. 5

b. 3

c. 6

d. 7

16 / 40

16.

 Select the correct example of complex datatype in Python

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

17 / 40

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

18 / 40

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

19 / 40

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

20 / 40

20. Python has syntax that allows developers to write programs with fewer lines than some other programming languages.

21 / 40

21.

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

22 / 40

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

23 / 40

23. Which of the following character is used to give single-line comments in Python?
a) //
b) #
c) !
d) /*

24 / 40

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

25 / 40

25.

What will be the output of above Python code?

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

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

26 / 40

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

27 / 40

27.

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

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

28 / 40

28.

Which function overloads the >> operator?

  1. more()
  2. gt()
  3. ge()
  4. None of the above

29 / 40

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

30 / 40

30.

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

31 / 40

31.

What will be the output of below Python code?

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

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

32 / 40

32.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

33 / 40

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

34 / 40

34.

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

a. [ ]

b. { }

c. ( )

d. None of the above

35 / 40

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

36 / 40

36. Comparison operators are not  used to compare two values

37 / 40

37. A variable name cannot start with a number

38 / 40

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

39 / 40

39. You have to use the same number of spaces in the same block of code, otherwise Python will give you an error

40 / 40

40.

 What is output of: 35 == 35.0

  1. False
  2. True
  3. 33
  4. 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.