[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

What is the value of the expression 100 / 25?

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

2 / 40

2. Comments can’t be used to prevent execution when testing code.

3 / 40

3.

Which of the following creates a tuple?

A. tuple1=(“a”,”b”)
B. tuple1[2]=(“a”,”b”)
C. tuple1=(5)*2
D. None of the above

4 / 40

4. Python is an interpreted programming language

5 / 40

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

6 / 40

6.

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

7 / 40

7. Comments starts with a #

8 / 40

8.

Which of the following precedence order is correct in Python?

  1. Parentheses, Exponential, Multiplication, Division, Addition, Subtraction
  2. Multiplication, Division, Addition, Subtraction, Parentheses, Exponential
  3. Division, Multiplication, Addition, Subtraction, Parentheses, Exponential
  4. Exponential, Parentheses, Multiplication, Division, Addition, Subtraction

9 / 40

9.

How to copy one list to another in python?

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

10 / 40

10.

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.

11 / 40

11. You can also have an else without the elif

12 / 40

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

13 / 40

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

14 / 40

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

15 / 40

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

16 / 40

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

17 / 40

17.

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

a. Define

b. DEF

c. def

d. Def

18 / 40

18. A variable name must start with a letter or the underscore character

19 / 40

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

20 / 40

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

21 / 40

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

22 / 40

22. Which of the following character is used to give single-line comments in Python?
a) //
b) #
c) !
d) /*

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. Comparison operators are not  used to compare two values

25 / 40

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

 

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.

Which is the correct operator for power(xy)?

  1. X^y
  2. X**y
  3. X^^y
  4. None of the mentioned

28 / 40

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

29 / 40

29. You can use the pop() method to remove an element from the array

30 / 40

30. Variable names are case-sensitive

31 / 40

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

32 / 40

32. Extension of all Python  Programme are .py

33 / 40

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

34 / 40

34.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

35 / 40

35.

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

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

36 / 40

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

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.

Choose the correct option with respect to Python.

A. Both tuples and lists are immutable.
B. Tuples are immutable while lists are mutable.
C. Both tuples and lists are mutable.
D. Tuples are mutable while lists are immutable.

39 / 40

39.

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

40 / 40

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

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.