[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

2 / 40

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

 

3 / 40

3.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

4 / 40

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

5 / 40

5.

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

a. [ ]

b. { }

c. ( )

d. None of the above

6 / 40

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

7 / 40

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

8 / 40

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

9 / 40

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

10 / 40

10.

 What is output of: 35 == 35.0

  1. False
  2. True
  3. 33
  4. None of the above

11 / 40

11.

Which function overloads the >> operator?

  1. more()
  2. gt()
  3. ge()
  4. None of the above

12 / 40

12.

Which is the correct operator for power(xy)?

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

13 / 40

13.

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

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

14 / 40

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

15 / 40

15.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

16 / 40

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

17 / 40

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

18 / 40

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

19 / 40

19.

What is the data type of print(type(0xFF))

20 / 40

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

21 / 40

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

22 / 40

22.

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

23 / 40

23.

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.

24 / 40

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

25 / 40

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

26 / 40

26. Python has various versions available

27 / 40

27. python file can also run on command line

28 / 40

28. Python can be install on both  Linux and  Windows

29 / 40

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

30 / 40

30. Who developed Python Programming Language?

31 / 40

31.

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

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

32 / 40

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

33 / 40

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

34 / 40

34.  ________ in Python is a counter-controlled loop.

a) for

b) while

c) Both (a) and (b)

d) None of the above

35 / 40

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

36 / 40

36.

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.

37 / 40

37. The for loop does not require an indexing variable to set beforehand

38 / 40

38.

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

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

39 / 40

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

40 / 40

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

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.