[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

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

3 / 40

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

4 / 40

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

5 / 40

5. Variable names are case-sensitive

6 / 40

6.

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.

7 / 40

7. Python allows you to extract the values into variables.

8 / 40

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

9 / 40

9. Python has syntax that allows developers to write programs with fewer lines than some other programming languages.

10 / 40

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

11 / 40

11. python has two primitive loop commands:

  • while loops
  • for loops

12 / 40

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

13 / 40

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

14 / 40

14.

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

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

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. Which of the following is the correct extension of the Python file?

17 / 40

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

18 / 40

18.

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

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

19 / 40

19.

Which of the following statement will execute in last?

def s(n1): #Statement 1      print(n1) #Statement 2n2=4 #Statement 3s(n2) #Statement 4

a. Statement 1

b. Statement 2

c. Statement 3

d. Statement 4

20 / 40

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

21 / 40

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

22 / 40

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

23 / 40

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

24 / 40

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

25 / 40

25.

The most important object defined in NumPy is an N-dimensional array type called?

A. ndarray
B. narray
C. nd_array
D. darray

26 / 40

26.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

27 / 40

27. Extension of all Python  Programme are .py

28 / 40

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

29 / 40

29.

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

30 / 40

30. What will be the output of the following Python code?

i = 1while True:    if i%3 == 0:        break    print(i)     i + = 1

a) 1 2
b) 1 2 3
c) error
d) none of the mentioned

31 / 40

31. Which of the following is the use of function in python?
a) Functions are reusable pieces of programs
b) Functions don’t provide better modularity for your application
c) you can’t also create your own functions
d) All of the mentioned

32 / 40

32. We can combine strings and numbers by using the format() method

33 / 40

33.

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

34 / 40

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

35 / 40

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

36 / 40

36. Comments can be used to explain Python code.

37 / 40

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

 

38 / 40

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

39 / 40

39. The len() method to return the length of an array

40 / 40

40.

Which is the correct operator for power(xy)?

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

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.