[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

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

3 / 40

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

 

4 / 40

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

5 / 40

5. Which of the following is a Python tuple?
a) [1, 2, 3]
b) (1, 2, 3)
c) {1, 2, 3}
d) {}

6 / 40

6. Python can be used to handle big data and perform complex mathematics.

7 / 40

7.

 Select the correct example of complex datatype in Python

  1. 3 + 2j
  2. -100j
  3. 5j
  4. All of the above are correct

8 / 40

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

9 / 40

9. An array can hold many values under a single name

10 / 40

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

11 / 40

11. python has two primitive loop commands:

  • while loops
  • for loops

12 / 40

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

13 / 40

13.

Write the output of the following code :

str = "Welcome"str[2] = 'a'print(str)

a. Weacome

b. Error

c. aWelcome

d. Welcomea

14 / 40

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

15 / 40

15.

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

a. [ ]

b. { }

c. ( )

d. None of the above

16 / 40

16. Python can connect to database systems.

17 / 40

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

a) for

b) while

c) Both (a) and (b)

d) None of the above

18 / 40

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

19 / 40

19.

Which function overloads the >> operator?

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

20 / 40

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

21 / 40

21.

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.

22 / 40

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

23 / 40

23.

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

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

24 / 40

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

25 / 40

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

26 / 40

26.

l = [ 4, 8, 9, 2.6, 5 ] is a type of which data type in python?

  1. List
  2. Tuple
  3. Set
  4. None of these

27 / 40

27.

 ____________________ 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

28 / 40

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

29 / 40

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

30 / 40

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

31 / 40

31. + operator is used  to get output of multiple variables

32 / 40

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

33 / 40

33. Comparison operators are not  used to compare two values

34 / 40

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

35 / 40

35.

Which is the correct operator for power(xy)?

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

36 / 40

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

37 / 40

37.

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

38 / 40

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

39 / 40

39.

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

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

40 / 40

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

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.