[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

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

3 / 40

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

4 / 40

4. Variables that are created outside of a function

5 / 40

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

6 / 40

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

7 / 40

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

8 / 40

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

9 / 40

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

10 / 40

10. Python has a set of built-in methods that you can use on lists/arrays

11 / 40

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

12 / 40

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

13 / 40

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

14 / 40

14.

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

15 / 40

15. A variable name cannot start with a number

16 / 40

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

17 / 40

17.

 Select the correct example of complex datatype in Python

  1. 3 + 2j
  2. -100j
  3. 5j
  4. All of the above are correct

18 / 40

18. Extension of all Python  Programme are .py

19 / 40

19. Python is an interpreted programming language

20 / 40

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

21 / 40

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

22 / 40

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

23 / 40

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

24 / 40

24. You can use the pop() method to remove an element from the array

25 / 40

25. Comments starts with a #

26 / 40

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

27 / 40

27. Which of the following is False regarding loops in Python?

a)Loops are used to perform certain tasks repeatedly.

b) while loop is used when multiple statements are to executed repeatedly until the given condition becomes true.

c) while loop is used when multiple statements are to executed repeatedly until the given condition becomes false.

d) for loop can be used to iterate through the elements of lists.

28 / 40

28.

Python considered the character enclosed in triple quotes as String.(T/F)

a. True

b. False

29 / 40

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

30 / 40

30.

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.

31 / 40

31.

Which is the correct operator for power(xy)?

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

32 / 40

32.

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

33 / 40

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

34 / 40

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

35 / 40

35.

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

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

36 / 40

36.

 What is output of: 35 == 35.0

  1. False
  2. True
  3. 33
  4. None of the above

37 / 40

37.

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

a. [ ]

b. { }

c. ( )

d. None of the above

38 / 40

38.

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.

39 / 40

39. An array is a special variable, which can hold more than one value at a time

40 / 40

40.

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

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

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.