[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

2.

 What is output of: 35 == 35.0

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

3 / 40

3. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

4 / 40

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

a. 5

b. 3

c. 6

d. 7

5 / 40

5. A variable name cannot start with a number

6 / 40

6. Indentation refers to the spaces at the beginning of a code line.

7 / 40

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

8 / 40

8. Comments can be used to explain Python code.

9 / 40

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

10 / 40

10. Python can be treated in a procedural way, an object-oriented way or a functional way.

11 / 40

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

12 / 40

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

13 / 40

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

14 / 40

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

15 / 40

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

16 / 40

16. You can have if statements inside if statements, this is called nested if statements.

17 / 40

17. Comments can’t be used to prevent execution when testing code.

18 / 40

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

19 / 40

19. The format() method takes the passed arguments

20 / 40

20. Pip is  not a powerful package management system for Python software packages

21 / 40

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

22 / 40

22.

Which of the following statements assigns the value 25 to the variable x in Python:

  1. x ← 25
  2. x = 25
  3. x := 25
  4. int x = 25
  5. x << 25

23 / 40

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

24 / 40

24. The elif keyword is pythons way of saying “if the previous conditions were not true, then try this condition”.

25 / 40

25.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

26 / 40

26.

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

27 / 40

27.

Which keyword is used to begin the definition of a function?

a. Define

b. DEF

c. def

d. Def

28 / 40

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

29 / 40

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

a) for

b) while

c) Both (a) and (b)

d) None of the above

30 / 40

30.

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

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

31 / 40

31. You can use the append() method to add an element to an array

32 / 40

32.

What will be the output of below Python code?

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

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

33 / 40

33.

What will be the output of above Python code?

str1="6/4"print("str1")

A. 1
B. 6/4
C. 1.5
D. str1

34 / 40

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

35 / 40

35. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

36 / 40

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

37 / 40

37.

 Select the correct example of complex datatype in Python

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

38 / 40

38. Variables that are created outside of a function

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

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.