[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. Camel Case
Each word, except the first, starts with a capital letter:

2 / 40

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

3 / 40

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

4 / 40

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

5 / 40

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

6 / 40

6. Python is an interpreted programming language

7 / 40

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

8 / 40

8. Operators are used to perform operations on variables and values

9 / 40

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

10 / 40

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

11 / 40

11. Variable names are case-sensitive

12 / 40

12.

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.

13 / 40

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

14 / 40

14. A for loop is used for iterating over a sequence (that is either a list, a tuple, a dictionary, a set, or a string).

15 / 40

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

16 / 40

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

x = ['ab', 'cd']for i in x:    i.upper()print(x)

a) [‘ab’, ‘cd’]
b) [‘AB’, ‘CD’]
c) [None, None]
d) none of the mentioned

17 / 40

17.

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

18 / 40

18.

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

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

19 / 40

19. Comments can’t be used to prevent execution when testing code.

20 / 40

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

21 / 40

21. Python is a  high-level programming language.

22 / 40

22. Which term describes a loop that continues repeating without a terminating (ending) condition?

a) Infinite Loop

b) Conditional Loop

c) Unlimited Loop

d) Sequence Loop

23 / 40

23.

What is the value of the expression 100 / 25?

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

24 / 40

24.

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

25 / 40

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

26 / 40

26. Comparison operators are not  used to compare two values

27 / 40

27. During Installation Make sure to select both the checkboxes at the bottom .

28 / 40

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

29 / 40

29.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

30 / 40

30. With the break statement we can stop the loop before it has looped through all the items

31 / 40

31. A variable name cannot start with a number

32 / 40

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

33 / 40

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

34 / 40

34. Comments starts with a #

35 / 40

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

36 / 40

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

 

37 / 40

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

38 / 40

38.

What is the data type of print(type(10))

39 / 40

39.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

40 / 40

40. You can also have an else without the elif

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.