[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

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

a. [ ]

b. { }

c. ( )

d. None of the above

2 / 40

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

3 / 40

3.

 ____________________ can be defined as a named group of instructions that accomplish a specific task when it is invoked/called.

a. Function

b. Datatype

c. Token

d. Operator

4 / 40

4. Official site of python is www.python.org

5 / 40

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

6 / 40

6. Python has various versions available

7 / 40

7.

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

8 / 40

8.

 Which of the following statement is False?

  1. Variable names can be arbitrarily long.
  2. They can contain both letters and numbers.
  3. Variable name can begin with underscore.
  4. Variable name can begin with number.

9 / 40

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

10 / 40

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

11 / 40

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

a. 5

b. 3

c. 6

d. 7

12 / 40

12. What is the output of the given below program?

if 1 + 3 == 7:    print("Hello")else:    print("Know Program")

a) Hello
b) Know Program
c) Compiled Successfully, No Output.
d) Error

13 / 40

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

14 / 40

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

 

15 / 40

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

16 / 40

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

17 / 40

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

18 / 40

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

19 / 40

19.

Which statement is correct?

A. List is immutable && Tuple is mutable
B. List is mutable && Tuple is immutable
C. Both are Mutable.
D. Both are Immutable

20 / 40

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

21 / 40

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

22 / 40

22. With the for loop we can execute a set of statements

23 / 40

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

24 / 40

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

25 / 40

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

26 / 40

26.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

27 / 40

27. Which of the following is False regarding loops in Python?

a)Loops are used to perform certain tasks repeatedly.

b) while loop is used when multiple statements are to executed repeatedly until the given condition becomes true.

c) while loop is used when multiple statements are to executed repeatedly until the given condition becomes false.

d) for loop can be used to iterate through the elements of lists.

28 / 40

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

29 / 40

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

30 / 40

30.

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

31 / 40

31.

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

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

32 / 40

32.

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

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

33 / 40

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

34 / 40

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

35 / 40

35. Python can be install on both  Linux and  Windows

36 / 40

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

37 / 40

37.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

38 / 40

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

39 / 40

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

40 / 40

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

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.