[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

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

3 / 40

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

4 / 40

4. Comments can be used to explain Python code.

5 / 40

5. Python relies on indentation?

6 / 40

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

7 / 40

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

8 / 40

8.

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

9 / 40

9. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

10 / 40

10.

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

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

11 / 40

11.

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.

12 / 40

12. Is there any comments in  following codes

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

 

13 / 40

13. What keyword would you use to add an alternative condition to an if statement?

a) else if
b) elseif
c) elif
d) None of the above

14 / 40

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

15 / 40

15. Most recent major version of Python is Python 3

16 / 40

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

17 / 40

17.

Choose the correct option with respect to Python.

A. Both tuples and lists are immutable.
B. Tuples are immutable while lists are mutable.
C. Both tuples and lists are mutable.
D. Tuples are mutable while lists are immutable.

18 / 40

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

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.

Write the output of the following code :

str = "Welcome"str[2] = 'a'print(str)

a. Weacome

b. Error

c. aWelcome

d. Welcomea

21 / 40

21.

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

22 / 40

22. The len() method to return the length of an array

23 / 40

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

24 / 40

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

25 / 40

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

26 / 40

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

27 / 40

27.

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

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

28 / 40

28. Who developed Python Programming Language?

29 / 40

29.

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

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

30 / 40

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

31 / 40

31. You can also have an else without the elif

32 / 40

32.

Which function overloads the >> operator?

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

33 / 40

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

34 / 40

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

35 / 40

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

36 / 40

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

37 / 40

37. Python has various versions available

38 / 40

38. What is the output of the given below program?

if 1 + 3 == 7:    print("Hello")else:    print("Know Program")

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

39 / 40

39.

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

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

40 / 40

40.

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

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.