[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

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

a. [ ]

b. { }

c. ( )

d. None of the above

2 / 40

2.

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.

3 / 40

3.

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

4 / 40

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

5 / 40

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

6 / 40

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

7 / 40

7.

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

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

8 / 40

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

9 / 40

9.

 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.

10 / 40

10.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

11 / 40

11. You can have if statements inside if statements, this is called nested if statements.

12 / 40

12. Python can be used on a server to create web applications?

13 / 40

13. Python is a  high-level programming language.

14 / 40

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

15 / 40

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

16 / 40

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

17 / 40

17. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

18 / 40

18.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

19 / 40

19. You can use the append() method to add an element to an array

20 / 40

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

21 / 40

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

22 / 40

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

23 / 40

23.

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

a. 2

b. 3

c. 5

d. Multiple times

24 / 40

24. Variables that are created outside of a function

25 / 40

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

26 / 40

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

27 / 40

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

28 / 40

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

29 / 40

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

30 / 40

30.

Which is the correct operator for power(xy)?

  1. X^y
  2. X**y
  3. X^^y
  4. None of the mentioned

31 / 40

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

32 / 40

32.

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.

33 / 40

33. Comments starts with a #

34 / 40

34.

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

35 / 40

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

36 / 40

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

37 / 40

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

38 / 40

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

39 / 40

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

40 / 40

40. Comments can’t be used to prevent execution when testing code.

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.