[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. Comments starts with a #

2 / 40

2.

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

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

3 / 40

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

4 / 40

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

5 / 40

5.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

6 / 40

6. Python relies on indentation?

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. Comments can’t be used to prevent execution when testing code.

9 / 40

9. What does the following code print?

x = -10if x < 0:    print("The negative number ",  x, " is not valid here.")print("This is always printed")
a.This is always printedb.The negative number -10 is not valid hereThis is always printedc.The negative number -10 is not valid here

10 / 40

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

11 / 40

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

12 / 40

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

13 / 40

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

14 / 40

14.

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

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

15 / 40

15.

 Which of the following statement is False?

  1. Variable names can be arbitrarily long.
  2. They can contain both letters and numbers.
  3. Variable name can begin with underscore.
  4. Variable name can begin with number.

16 / 40

16.

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.

17 / 40

17.

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

18 / 40

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

19 / 40

19. Is Python code compiled or interpreted?
a) Python code is both compiled and interpreted
b) Python code is neither compiled nor interpreted
c) Python code is only compiled
d) Python code is only interpreted

20 / 40

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

21 / 40

21.

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

a. Define

b. DEF

c. def

d. Def

22 / 40

22.

What will be the output of below Python code?

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

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

23 / 40

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

24 / 40

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

25 / 40

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

26 / 40

26.

What is the value of the expression 100 / 25?

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

27 / 40

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

28 / 40

28. Python has various versions available

29 / 40

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

30 / 40

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

31 / 40

31. With the break statement we can stop the loop even if the while condition is true

32 / 40

32.

What is the data type of print(type(10))

33 / 40

33. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

34 / 40

34. You can also have an else without the elif

35 / 40

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

a. 5

b. 3

c. 6

d. 7

36 / 40

36. python has two primitive loop commands:

  • while loops
  • for loops

37 / 40

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

38 / 40

38.

Which function overloads the >> operator?

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

39 / 40

39. Python is a  high-level programming language.

40 / 40

40. Python can be install on both  Linux and  Windows

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.