[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. Is Python code compiled or interpreted?
a) Python code is both compiled and interpreted
b) Python code is neither compiled nor interpreted
c) Python code is only compiled
d) Python code is only interpreted

2 / 40

2.

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

a. [ ]

b. { }

c. ( )

d. None of the above

3 / 40

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

4 / 40

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

5 / 40

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

6 / 40

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

7 / 40

7.

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

a. Define

b. DEF

c. def

d. Def

8 / 40

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

9 / 40

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

10 / 40

10.

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

11 / 40

11.

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

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.

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

a. 2

b. 3

c. 5

d. Multiple times

14 / 40

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

15 / 40

15. Python can connect to database systems.

16 / 40

16.

Which of the following statement will execute in last?

def s(n1): #Statement 1      print(n1) #Statement 2n2=4 #Statement 3s(n2) #Statement 4

a. Statement 1

b. Statement 2

c. Statement 3

d. Statement 4

17 / 40

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

18 / 40

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

19 / 40

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

20 / 40

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

21 / 40

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

22 / 40

22. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

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. Operators are used to perform operations on variables and values

25 / 40

25. Python relies on indentation?

26 / 40

26. Find the output of the given Python program?

a = 25if a < 15:    print("Hi")if a <= 30:    print("Hello")else:    print("Know Program")

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

27 / 40

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

28 / 40

28.

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

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

29 / 40

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

30 / 40

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

31 / 40

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

32 / 40

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

33 / 40

33. An array can hold many values under a single name

34 / 40

34.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

35 / 40

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

36 / 40

36.  ________ in Python is a counter-controlled loop.

a) for

b) while

c) Both (a) and (b)

d) None of the above

37 / 40

37.

 What is output of: 35 == 35.0

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

38 / 40

38. Python is a  high-level programming language.

39 / 40

39.

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

a. True

b. False

40 / 40

40. You can also have an else without the elif

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.