[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. Arrays are used to store multiple values in one single variable.

2 / 40

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

3 / 40

3.

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

a. True

b. False

4 / 40

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

5 / 40

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

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

a) Hi
b) Know Program

c)
Hi
Hello

d)
Know Program
Hello

6 / 40

6.

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.

7 / 40

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

8 / 40

8.

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

a. 2

b. 3

c. 5

d. Multiple times

9 / 40

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

10 / 40

10.

Which is the correct operator for power(xy)?

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

11 / 40

11. Python can connect to database systems.

12 / 40

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

13 / 40

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

14 / 40

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

15 / 40

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

16 / 40

16. Python is an interpreted programming language

17 / 40

17.

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

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

18 / 40

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

19 / 40

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

20 / 40

20.

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

a. Define

b. DEF

c. def

d. Def

21 / 40

21. You can also have an else without the elif

22 / 40

22. Python is a  high-level programming language.

23 / 40

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

24 / 40

24.

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.

25 / 40

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

26 / 40

26. Python can be used to handle big data and perform complex mathematics.

27 / 40

27.

 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.

28 / 40

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

29 / 40

29.

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

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

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. What will be the output of the following Python code?

x = ['ab', 'cd']for i in x:    i.upper()print(x)

a) [‘ab’, ‘cd’]
b) [‘AB’, ‘CD’]
c) [None, None]
d) none of the mentioned

32 / 40

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

33 / 40

33. What does the following code print?

x = -10if x < 0:    print("The negative number ",  x, " is not valid here.")print("This is always printed")
a.This is always printedb.The negative number -10 is not valid hereThis is always printedc.The negative number -10 is not valid here

34 / 40

34.

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

35 / 40

35. Pascal Case
Each word starts with a capital letter:

36 / 40

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

37 / 40

37. Python can be install on both  Linux and  Windows

38 / 40

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

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. The list’s remove() method only removes the first occurrence of the specified value.

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.