[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

2 / 40

2.

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

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

3 / 40

3. Variable names are case-sensitive

4 / 40

4. Python is an interpreted programming language

5 / 40

5.

In the Python statement x = a + 5 – b:

a and b are ________a + 5 - b is ________
  1. terms, a group
  2. operators, a statement
  3. operands, an expression
  4. operands, an equation

6 / 40

6. The for loop in Python is an _____________

a) Entry Controlled Loop

b) Exit Controlled Loop

c) Both of the above

d) None of the above

7 / 40

7.

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

8 / 40

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

9 / 40

9. Which of the following is False regarding loops in Python?

a)Loops are used to perform certain tasks repeatedly.

b) while loop is used when multiple statements are to executed repeatedly until the given condition becomes true.

c) while loop is used when multiple statements are to executed repeatedly until the given condition becomes false.

d) for loop can be used to iterate through the elements of lists.

10 / 40

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

11 / 40

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

12 / 40

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

13 / 40

13. python file can also run on command line

14 / 40

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

15 / 40

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

16 / 40

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

17 / 40

17.

What is the value of the expression 100 / 25?

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

18 / 40

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

19 / 40

19. Extension of all Python  Programme are .py

20 / 40

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

21 / 40

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

22 / 40

22. During Installation Make sure to select both the checkboxes at the bottom .

23 / 40

23.

 ____________________ 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

24 / 40

24. Python has syntax that allows developers to write programs with fewer lines than some other programming languages.

25 / 40

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

26 / 40

26.

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

27 / 40

27.

Which function overloads the >> operator?

  1. more()
  2. gt()
  3. ge()
  4. None of the above

28 / 40

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

29 / 40

29. To insert characters that are illegal in a string, use an escape character

30 / 40

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

31 / 40

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

32 / 40

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

33 / 40

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

34 / 40

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

35 / 40

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

36 / 40

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

37 / 40

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

38 / 40

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

39 / 40

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

40 / 40

40.

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.

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.