[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

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

2 / 40

2.

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

3 / 40

3. Is there any comments in  following codes

i = 1while True:    if i%3 == 0:        break    print(i)     i + = 1

 

4 / 40

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

5 / 40

5. Pascal Case
Each word starts with a capital letter:

6 / 40

6. Comments starts with a #

7 / 40

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

8 / 40

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

9 / 40

9. Which of the following is the correct extension of the Python file?

10 / 40

10.

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.

11 / 40

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

12 / 40

12. Python is an interpreted programming language

13 / 40

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

14 / 40

14. A variable name cannot start with a number

15 / 40

15.

What will be the output of below Python code?

str1="Information"print(str1[2:8])

A. format
B. formatio
C. orma
D. ormat

16 / 40

16.

What will be the output of below Python code?

str1="poWer"str1.upper()print(str1)

A. POWER
B. Power
C. power
D. poWer

17 / 40

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

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

20 / 40

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

21 / 40

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

22 / 40

22. Python relies on indentation?

23 / 40

23. Variables that are created outside of a function

24 / 40

24. Python is a  high-level programming language.

25 / 40

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

26 / 40

26.

In a program, a function can be called ____________ times.

a. 2

b. 3

c. 5

d. Multiple times

27 / 40

27.

Which is the correct operator for power(xy)?

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

28 / 40

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

29 / 40

29. A variable name must start with a letter or the underscore character

30 / 40

30. The list’s remove() method only removes the first occurrence of the specified value.

31 / 40

31.

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

32 / 40

32.

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

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

33 / 40

33.

 What is output of: 35 == 35.0

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

34 / 40

34.

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

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

35 / 40

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

36 / 40

36.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

37 / 40

37.

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

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

38 / 40

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

39 / 40

39.

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

40 / 40

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

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.