[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. Who developed Python Programming Language?

2 / 40

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

3 / 40

3.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

4 / 40

4. You can return a range of characters by using the slice syntax

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 the append() method to add an element to an array

7 / 40

7. python file can also run on command line

8 / 40

8.

How to copy one list to another in python?

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

9 / 40

9.

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

10 / 40

10.

Which is the correct operator for power(xy)?

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

11 / 40

11. Python is an interpreted programming language

12 / 40

12. Python will give you an error if you skip the indentation

13 / 40

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

14 / 40

14.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

15 / 40

15.

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

16 / 40

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

17 / 40

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

18 / 40

18. Python  was created by Guido van Rossum, and released in 1999.

19 / 40

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

20 / 40

20. Comparison operators are not  used to compare two values

21 / 40

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

22 / 40

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

23 / 40

23. Python is a  high-level programming language.

24 / 40

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

25 / 40

25.

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.

26 / 40

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

27 / 40

27. You can also have an else without the elif

28 / 40

28. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

29 / 40

29.

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

30 / 40

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

31 / 40

31. Is Python code compiled or interpreted?
a) Python code is both compiled and interpreted
b) Python code is neither compiled nor interpreted
c) Python code is only compiled
d) Python code is only interpreted

32 / 40

32.

What will be the output of above Python code?

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

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

33 / 40

33. Arrays are used to store multiple values in one single variable.

34 / 40

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

35 / 40

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

36 / 40

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

37 / 40

37.

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.

38 / 40

38. Identity operators are used to compare the objects, not if they are equal, but if they are actually the same object, with the same memory location

39 / 40

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

40 / 40

40. Which of the following loop is not supported by the python programming language?

a) for loop

b) while loop

c) do…while loop

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.