[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

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

2 / 40

2. Python can be install on both  Linux and  Windows

3 / 40

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

4 / 40

4. Comments starts with a #

5 / 40

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

6 / 40

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

7 / 40

7.

 Select the correct example of complex datatype in Python

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

8 / 40

8.

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

a. 2

b. 3

c. 5

d. Multiple times

9 / 40

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

10 / 40

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

11 / 40

11. The format() method takes unlimited number of arguments

12 / 40

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

13 / 40

13.

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

a. Define

b. DEF

c. def

d. Def

14 / 40

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

15 / 40

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

16 / 40

16.

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

a. True

b. False

17 / 40

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

18 / 40

18.

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

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

19 / 40

19. Comparison operators are not  used to compare two values

20 / 40

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

21 / 40

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

22 / 40

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

23 / 40

23. Python has various versions available

24 / 40

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

25 / 40

25. Python can connect to database systems.

26 / 40

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

27 / 40

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

28 / 40

28.

Which is the correct operator for power(xy)?

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

29 / 40

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

30 / 40

30. Who developed Python Programming Language?

31 / 40

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

32 / 40

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

33 / 40

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

34 / 40

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

35 / 40

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

36 / 40

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

37 / 40

37. + operator is used  to get output of multiple variables

38 / 40

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

39 / 40

39.

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.

40 / 40

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

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.