[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

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

3 / 40

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

4 / 40

4.

What is the value of the expression 100 / 25?

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

5 / 40

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

6 / 40

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

7 / 40

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

8 / 40

8.

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

9 / 40

9. python has two primitive loop commands:

  • while loops
  • for loops

10 / 40

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

11 / 40

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

12 / 40

12.

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

13 / 40

13.

Choose the correct option with respect to Python.

A. Both tuples and lists are immutable.
B. Tuples are immutable while lists are mutable.
C. Both tuples and lists are mutable.
D. Tuples are mutable while lists are immutable.

14 / 40

14.

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

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

15 / 40

15.

Which of the following creates a tuple?

A. tuple1=(“a”,”b”)
B. tuple1[2]=(“a”,”b”)
C. tuple1=(5)*2
D. None of the above

16 / 40

16. Python is a  high-level programming language.

17 / 40

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

18 / 40

18.

 Select the correct example of complex datatype in Python

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

19 / 40

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

20 / 40

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

21 / 40

21. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

22 / 40

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

23 / 40

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

24 / 40

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

25 / 40

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

26 / 40

26.

What will be the output of below Python code?

tupl=([2,3],"abc",0,9)tupl[0][1]=1print(tupl)A. ([2,3],"abc",0,9)B. ([1,3],"abc",0,9)C. ([2,1],"abc",0,9)D. Error

27 / 40

27. The for loop in Python is an _____________

a) Entry Controlled Loop

b) Exit Controlled Loop

c) Both of the above

d) None of the above

28 / 40

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

29 / 40

29.

Python considered the character enclosed in triple quotes as String.(T/F)

a. True

b. False

30 / 40

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

31 / 40

31. Python is an interpreted programming language

32 / 40

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

33 / 40

33.

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

34 / 40

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

35 / 40

35.

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

36 / 40

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

37 / 40

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

38 / 40

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

39 / 40

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

40 / 40

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

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.