[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. Extension of all Python  Programme are .py

2 / 40

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

3 / 40

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

4 / 40

4. With the break statement we can stop the loop even if the while condition is true

5 / 40

5.

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

6 / 40

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

7 / 40

7. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

8 / 40

8. The format() method takes the passed arguments

9 / 40

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

10 / 40

10. When does the else statement written after loop executes?

a) When loop condition becomes false

b) When break statement is executed in the loop

c) else statement is always executed

d) None of the above

11 / 40

11. Comparison operators are not  used to compare two values

12 / 40

12. 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()

 

13 / 40

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

14 / 40

14.

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.

15 / 40

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

16 / 40

16. Comments starts with a #

17 / 40

17. Bitwise operators are used to compare (binary) numbers

18 / 40

18.

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.

19 / 40

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

20 / 40

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

21 / 40

21.

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

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

22 / 40

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

23 / 40

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

24 / 40

24. Arithmetic operators are used with numeric values to perform common mathematical operations

25 / 40

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

26 / 40

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

27 / 40

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

28 / 40

28.

Which function overloads the >> operator?

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

29 / 40

29. python file can also run on command line

30 / 40

30.

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

31 / 40

31.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

32 / 40

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

33 / 40

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

34 / 40

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

35 / 40

35.

 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.

36 / 40

36.

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

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

37 / 40

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

38 / 40

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

39 / 40

39.

What will be the output of above Python code?

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

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

40 / 40

40. Is there any comments in  following codes

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

 

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.