[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

2.

Which function overloads the >> operator?

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

3 / 40

3. Is there any comments in  following codes

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

 

4 / 40

4. Strings in python are surrounded by either single quotation marks, or double quotation marks

5 / 40

5.

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

6 / 40

6.

In a program, a function can be called ____________ times.

a. 2

b. 3

c. 5

d. Multiple times

7 / 40

7. break in Python is used ______________

a) To restart a loop

b) Terminate a loop

c) To jump in between the loop

d) None of the above

8 / 40

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

9 / 40

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

10 / 40

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

11 / 40

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

12 / 40

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

13 / 40

13.

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

14 / 40

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

15 / 40

15. A variable name can only contain alpha-numeric characters and
underscores

16 / 40

16.

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

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

17 / 40

17.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

18 / 40

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

19 / 40

19.

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

a. Define

b. DEF

c. def

d. Def

20 / 40

20. To write and execute code in python, we first need to install Python on our system.

21 / 40

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

22 / 40

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

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. Comments can’t be used to prevent execution when testing code.

25 / 40

25.

Which of the following creates a tuple?

A. tuple1=(“a”,”b”)
B. tuple1[2]=(“a”,”b”)
C. tuple1=(5)*2
D. None of the above

26 / 40

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

27 / 40

27. Python can be install on both  Linux and  Windows

28 / 40

28. Python is a  high-level programming language.

29 / 40

29. To write and execute code in python, we first need to install Python on our system

30 / 40

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

31 / 40

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

32 / 40

32.

Which one of the following is the correct extension of the Python file?

  1. .py
  2. .python
  3. .p
  4. None of these

33 / 40

33.

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

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

34 / 40

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

35 / 40

35. You can also have an else without the elif

36 / 40

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

37 / 40

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

38 / 40

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

39 / 40

39.

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

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

40 / 40

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

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.