[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

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

3 / 40

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

4 / 40

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

a) for

b) while

c) Both (a) and (b)

d) None of the above

5 / 40

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

6 / 40

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

a. 5

b. 3

c. 6

d. 7

7 / 40

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

8 / 40

8. if statements cannot be empty, but if you for some reason have an if statement with no content, put in the pass statement to avoid getting an error

9 / 40

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

10 / 40

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

11 / 40

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

12 / 40

12.

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

a. Define

b. DEF

c. def

d. Def

13 / 40

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

14 / 40

14.

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

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

15 / 40

15. Variable names are case-sensitive

16 / 40

16.

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

a. [ ]

b. { }

c. ( )

d. None of the above

17 / 40

17.

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

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

18 / 40

18. The length of an array is always one more than the highest array index.

19 / 40

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

20 / 40

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

21 / 40

21. Python will give you an error if you skip the indentation

22 / 40

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

23 / 40

23. Python can connect to database systems.

24 / 40

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

25 / 40

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

26 / 40

26.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

27 / 40

27.

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

28 / 40

28. You can return a range of characters by using the slice syntax

29 / 40

29. Find the output of the given Python program?

a = 25if a < 15:    print("Hi")if a <= 30:    print("Hello")else:    print("Know Program")

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

30 / 40

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

31 / 40

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

32 / 40

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

33 / 40

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

34 / 40

34.

What will be the output of below Python code?

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

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

35 / 40

35. Most recent major version of Python is Python 3

36 / 40

36. Snake Case
Each word is separated by an underscore character:

37 / 40

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

38 / 40

38. A for loop is used for iterating over a sequence (that is either a list, a tuple, a dictionary, a set, or a string).

39 / 40

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

40 / 40

40.

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

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.