[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

2.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

3 / 40

3. The format() method takes the passed arguments

4 / 40

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

 

5 / 40

5.

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

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

6 / 40

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

7 / 40

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

8 / 40

8. Comments starts with a #

9 / 40

9. Variable names are case-sensitive

10 / 40

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

11 / 40

11.

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

12 / 40

12.  ________ in Python is a counter-controlled loop.

a) for

b) while

c) Both (a) and (b)

d) None of the above

13 / 40

13.

What will the below Python code will return?

If str1="save paper,save plants"str1.find("save")

A. It returns the first index position of the first occurance of “save” in the given string str1.
B. It returns the last index position of the last occurance of “save” in the given string str1.
C. It returns the last index position of the first occurance of “save” in the given string str1.
D. It returns the first index position of the first occurance of “save” in the given string str1.

14 / 40

14. With the break statement we can stop the loop even if the while condition is true

15 / 40

15.

In Python, a variable may be assigned a value of one type, and then later assigned a value of a different type:

  1. False
  2. True

16 / 40

16. Python is an interpreted programming language

17 / 40

17. Bitwise operators are used to compare (binary) numbers

18 / 40

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

19 / 40

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

20 / 40

20. Extension of all Python  Programme are .py

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. The list’s remove() method only removes the first occurrence of the specified value.

23 / 40

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

24 / 40

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

25 / 40

25.

Which function overloads the >> operator?

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

26 / 40

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

27 / 40

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

28 / 40

28.

How to copy one list to another in python?

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

29 / 40

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

30 / 40

30. Python has various versions available

31 / 40

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

32 / 40

32.

 What is output of: 35 == 35.0

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

33 / 40

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

34 / 40

34.

What do we use to define a block of code in Python language?

  1. Key
  2. Brackets
  3. Indentation
  4. None of these

35 / 40

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

36 / 40

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

37 / 40

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

38 / 40

38.

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

39 / 40

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

40 / 40

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

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.