[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

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

3 / 40

3.

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

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

4 / 40

4.

 ____________________ 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

5 / 40

5. Which of the following is a Python tuple?
a) [1, 2, 3]
b) (1, 2, 3)
c) {1, 2, 3}
d) {}

6 / 40

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

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

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

7 / 40

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

8 / 40

8.

What is the value of the expression 100 / 25?

  1. 4
  2. 4.0
  3. 0
  4. 25

9 / 40

9. Python has various versions available

10 / 40

10. Comments can be used to explain Python code.

11 / 40

11.

What will be the output of above Python code?

str1="6/4"print("str1")

A. 1
B. 6/4
C. 1.5
D. str1

12 / 40

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

13 / 40

13.

 Select the correct example of complex datatype in Python

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

14 / 40

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

15 / 40

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

16 / 40

16.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

17 / 40

17.

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

18 / 40

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

19 / 40

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

20 / 40

20. Variable names are case-sensitive

21 / 40

21. Is there any comments in  following codes

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

 

22 / 40

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

23 / 40

23.

What will be the output of below Python code?

str1="poWer"str1.upper()print(str1)

A. POWER
B. Power
C. power
D. poWer

24 / 40

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

25 / 40

25.

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

26 / 40

26.

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

a. [ ]

b. { }

c. ( )

d. None of the above

27 / 40

27.

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

28 / 40

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

29 / 40

29.

 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.

30 / 40

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

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. What is the index value of ‘i’ in string “Learning”

a. 5

b. 3

c. 6

d. 7

33 / 40

33. 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”

34 / 40

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

35 / 40

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

36 / 40

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

37 / 40

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

38 / 40

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

39 / 40

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

40 / 40

40. Which of the following loop is not supported by the python programming language?

a) for loop

b) while loop

c) do…while loop

d) None of the above

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.