[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

Which is the correct operator for power(xy)?

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

2 / 40

2. Python is an interpreted programming language

3 / 40

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

4 / 40

4. An example of an illegal character is a double quote inside a string that is surrounded by double quotes

5 / 40

5.

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

6 / 40

6.

Write the output of the following code :

str = "Welcome"str[2] = 'a'print(str)

a. Weacome

b. Error

c. aWelcome

d. Welcomea

7 / 40

7.

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

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

8 / 40

8.

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.

9 / 40

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

10 / 40

10.

The function can be called in the program by writing function name followed by ____

a. [ ]

b. { }

c. ( )

d. None of the above

11 / 40

11. Python relies on indentation?

12 / 40

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

13 / 40

13.

Python considered the character enclosed in triple quotes as String.(T/F)

a. True

b. False

14 / 40

14.

What will be the output of above Python code?

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

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

15 / 40

15. A variable name cannot start with a number

16 / 40

16. You can also have multiple else statements on the same line:

17 / 40

17.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

18 / 40

18. The format() method takes unlimited number of arguments

19 / 40

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

20 / 40

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

21 / 40

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

22 / 40

22.

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.

23 / 40

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

24 / 40

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

25 / 40

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

26 / 40

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

27 / 40

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

28 / 40

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

29 / 40

29.

What will be the output of below Python code?

str1="Information"print(str1[2:8])

A. format
B. formatio
C. orma
D. ormat

30 / 40

30. You can also have an else without the elif

31 / 40

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

32 / 40

32. + operator is used  to get output of multiple variables

33 / 40

33. Arithmetic operators are used with numeric values to perform common mathematical operations

34 / 40

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

35 / 40

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

36 / 40

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

37 / 40

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

38 / 40

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

39 / 40

39.

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.

40 / 40

40. if statements cannot be empty, but if you for some reason have an if statement with no content, put in the pass statement to avoid getting an error

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.