[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

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

2 / 40

2.

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.

3 / 40

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

4 / 40

4.

 What is output of: 35 == 35.0

  1. False
  2. True
  3. 33
  4. None of the above

5 / 40

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

6 / 40

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

7 / 40

7. Most recent major version of Python is Python 3

8 / 40

8.

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

9 / 40

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

10 / 40

10. A variable name cannot start with a number

11 / 40

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

12 / 40

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

a. 5

b. 3

c. 6

d. 7

13 / 40

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

14 / 40

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

15 / 40

15.

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

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

16 / 40

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

17 / 40

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

18 / 40

18. python file can also run on command line

19 / 40

19. A variable name must start with a letter or the underscore character

20 / 40

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

21 / 40

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

22 / 40

22. The format() method takes unlimited number of arguments

23 / 40

23. Which term describes a loop that continues repeating without a terminating (ending) condition?

a) Infinite Loop

b) Conditional Loop

c) Unlimited Loop

d) Sequence Loop

24 / 40

24. Comments can be used to explain Python code.

25 / 40

25. The elif keyword is pythons way of saying “if the previous conditions were not true, then try this condition”.

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

28 / 40

28. Extension of all Python  Programme are .py

29 / 40

29. Find the output of the given Python program?

a, b, c = 1, 3, 5if a > 0:  if b < 2:    print("Hi")  elif c > 3:    print("Hello")else:  print("Know Program")

a) Hi
b) Hello
c) Know Program
d) Compiled Successfully, No Output.

30 / 40

30.

What is the value of the expression 100 / 25?

  1. 4
  2. 4.0
  3. 0
  4. 25

31 / 40

31. Variables that are created outside of a function

32 / 40

32. X wants to allow the program to repeatedly ask the user to enter their Choice if it does not equal the Answer. Which loop option should X use?

a) while Choice == Answer:

Choice = input()

b) while Choice != Answer:

Choice = input()

c) while Answer != Choice:

Choice = input()

d) while Answer =! Choice:

Choice = input()

 

33 / 40

33.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

34 / 40

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

35 / 40

35.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

36 / 40

36. Which of the following is the use of function in python?
a) Functions are reusable pieces of programs
b) Functions don’t provide better modularity for your application
c) you can’t also create your own functions
d) All of the mentioned

37 / 40

37.

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

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

38 / 40

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

39 / 40

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

40 / 40

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

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.