[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

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. Python is an interpreted programming language

4 / 40

4. Python can be used to handle big data and perform complex mathematics.

5 / 40

5.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

6 / 40

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

7 / 40

7.

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.

8 / 40

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

9 / 40

9. python has two primitive loop commands:

  • while loops
  • for loops

10 / 40

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

11 / 40

11. Suppose t = (1, 2, 4, 3), which of the following is incorrect?
a) print(t[3])
b) t[3] = 45
c) print(max(t))
d) print(len(t))

12 / 40

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

13 / 40

13. Python has various versions available

14 / 40

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

15 / 40

15.

What will be the output of below Python code?

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

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

16 / 40

16. Python has a set of built-in methods that you can use on lists/arrays

17 / 40

17.

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.

18 / 40

18.

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

a. True

b. False

19 / 40

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

20 / 40

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

21 / 40

21. Variables that are created outside of a function

22 / 40

22. The elif keyword is pythons way of saying “if the previous conditions were not true, then try this condition”.

23 / 40

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

24 / 40

24.

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.

25 / 40

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

26 / 40

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

27 / 40

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

28 / 40

28.

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

29 / 40

29. The else keyword catches anything which isn’t caught by the preceding conditions.

30 / 40

30. Comments can be used to explain Python code.

31 / 40

31.

What will be the output of below Python code?

str1="poWer"str1.upper()print(str1)

A. POWER
B. Power
C. power
D. poWer

32 / 40

32. What is the index value of ‘i’ in string “Learning”

a. 5

b. 3

c. 6

d. 7

33 / 40

33. Python can connect to database systems.

34 / 40

34.

What is the value of the expression 100 / 25?

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

35 / 40

35. You can also have an else without the elif

36 / 40

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

37 / 40

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

38 / 40

38. Which keyword is used for function?
a) Fun
b) Define
c) Def
d) Function

39 / 40

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

40 / 40

40.

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

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

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.