[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

2 / 40

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

3 / 40

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

4 / 40

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

5 / 40

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

6 / 40

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

7 / 40

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

8 / 40

8. Camel Case
Each word, except the first, starts with a capital letter:

9 / 40

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

10 / 40

10.

What will be the output of above Python code?

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

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

11 / 40

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

12 / 40

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

13 / 40

13.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

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. With the break statement we can stop the loop before it has looped through all the items

16 / 40

16. Comments starts with a #

17 / 40

17. Python relies on indentation?

18 / 40

18.

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

19 / 40

19. Python can be install on both  Linux and  Windows

20 / 40

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

21 / 40

21.

 What is output of: 35 == 35.0

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

22 / 40

22.

How to copy one list to another in python?

A. l1[] = l2[]
B. l1[] = l2
C. l1[] = l2[:]
D. l1 = l2

23 / 40

23.

 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.

24 / 40

24. The list’s remove() method only removes the first occurrence of the specified value.

25 / 40

25. Comparison operators are not  used to compare two values

26 / 40

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

27 / 40

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

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. Arithmetic operators are used with numeric values to perform common mathematical operations

30 / 40

30. Who developed Python Programming Language?

31 / 40

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

32 / 40

32. Comments can be used to explain Python code.

33 / 40

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

34 / 40

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

35 / 40

35.

Which of the following statements assigns the value 25 to the variable x in Python:

  1. x ← 25
  2. x = 25
  3. x := 25
  4. int x = 25
  5. x << 25

36 / 40

36. Find the output of the given Python program?

a, b, c = 1, 3, 5if a > 0:  if b < 2:    print("Hi")  elif c > 3:    print("Hello")else:  print("Know Program")

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

37 / 40

37.

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

38 / 40

38. Python is a  high-level programming language.

39 / 40

39. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

40 / 40

40. You can also use the remove() method to remove an element from the array

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.