[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

2. Which of the following is used to define a block of code in Python language?
a) Indentation
b) Key
c) Brackets
d) All of the mentioned

3 / 40

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

4 / 40

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

5 / 40

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

a) for

b) while

c) Both (a) and (b)

d) None of the above

6 / 40

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

7 / 40

7. Python is a  high-level programming language.

8 / 40

8. A variable name cannot start with a number

9 / 40

9.

What will be the output of below Python code?

tupl=([2,3],"abc",0,9)tupl[0][1]=1print(tupl)A. ([2,3],"abc",0,9)B. ([1,3],"abc",0,9)C. ([2,1],"abc",0,9)D. Error

10 / 40

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

11 / 40

11. Operators are used to perform operations on variables and values

12 / 40

12. What will be the output of the following Python code?

  1. d = {"john":40, "peter":45}
  2. d["john"]

a) 40
b) 45
c) “john”
d) “peter”

13 / 40

13.

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

14 / 40

14.

Function defined to achieve some task as per the programmer’s requirement is called a ___________

a. user defined function

b. library function

c. built in functions

d. All of the above.

15 / 40

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

16 / 40

16.

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

17 / 40

17. Which term describes a loop that continues repeating without a terminating (ending) condition?

a) Infinite Loop

b) Conditional Loop

c) Unlimited Loop

d) Sequence Loop

18 / 40

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

19 / 40

19.

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

a. [ ]

b. { }

c. ( )

d. None of the above

20 / 40

20.

 ____________________ can be defined as a named group of instructions that accomplish a specific task when it is invoked/called.

a. Function

b. Datatype

c. Token

d. Operator

21 / 40

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

22 / 40

22. Is there any comments in  following codes

i = 1while True:    if i%3 == 0:        break    print(i)     i + = 1

 

23 / 40

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

24 / 40

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

25 / 40

25.

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

26 / 40

26. Python can connect to database systems.

27 / 40

27.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

28 / 40

28.

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

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

29 / 40

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

30 / 40

30. Snake Case
Each word is separated by an underscore character:

31 / 40

31. Python has various versions available

32 / 40

32. The elif keyword is pythons way of saying “if the previous conditions were not true, then try this condition”.

33 / 40

33. python file can also run on command line

34 / 40

34. The length of an array is always one more than the highest array index.

35 / 40

35. Python can be install on both  Linux and  Windows

36 / 40

36. Comparison operators are not  used to compare two values

37 / 40

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

38 / 40

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

39 / 40

39. With the break statement we can stop the loop before it has looped through all the items

40 / 40

40. Python can be treated in a procedural way, an object-oriented way or a functional way.

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.