[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

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

2 / 40

2.

How to copy one list to another in python?

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

3 / 40

3.

 ____________________ 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

4 / 40

4.

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

5 / 40

5. X wants to allow the program to repeatedly ask the user to enter their Choice if it does not equal the Answer. Which loop option should X use?

a) while Choice == Answer:

Choice = input()

b) while Choice != Answer:

Choice = input()

c) while Answer != Choice:

Choice = input()

d) while Answer =! Choice:

Choice = input()

 

6 / 40

6.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

7 / 40

7.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

8 / 40

8. A variable name cannot start with a number

9 / 40

9. Comments can be used to explain Python code.

10 / 40

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

11 / 40

11. You can also have an else without the elif

12 / 40

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

13 / 40

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

14 / 40

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

15 / 40

15. python file can also run on command line

16 / 40

16. The for loop does not require an indexing variable to set beforehand

17 / 40

17. You can use three double quotes only:

a = “””Lorem ipsum dolor sit amet,
consectetur adipiscing elit,
sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua.”””
print(a)

18 / 40

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

19 / 40

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

20 / 40

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

21 / 40

21. Comments starts with a #

22 / 40

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

23 / 40

23.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

24 / 40

24. Python can be install on both  Linux and  Windows

25 / 40

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

26 / 40

26. Python is a  high-level programming language.

27 / 40

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

28 / 40

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

29 / 40

29.

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

a. Define

b. DEF

c. def

d. Def

30 / 40

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

31 / 40

31. Is there any comments in  following codes

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

 

32 / 40

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

33 / 40

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

34 / 40

34.

 What is output of: 35 == 35.0

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

35 / 40

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

36 / 40

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

37 / 40

37. Comparison operators are not  used to compare two values

38 / 40

38. Python allows you to extract the values into variables.

39 / 40

39.

What is the value of the expression 100 / 25?

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

40 / 40

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

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.