[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

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

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

2 / 40

2. python file can also run on command line

3 / 40

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

4 / 40

4.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

5 / 40

5.

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

6 / 40

6. When does the else statement written after loop executes?

a) When loop condition becomes false

b) When break statement is executed in the loop

c) else statement is always executed

d) None of the above

7 / 40

7. Comparison operators are not  used to compare two values

8 / 40

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

9 / 40

9. You can also have multiple else statements on the same line:

10 / 40

10. You have to use the same number of spaces in the same block of code, otherwise Python will give you an error

11 / 40

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

12 / 40

12.

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

a. Define

b. DEF

c. def

d. Def

13 / 40

13. Find and write the output of the following python code:

x = “abcdef”

i = “a”

while i in x:

print(i, end = ” “)

a) a

b) a a a a a a

c) a a a a a a … infinite times

d) Code will generate error

14 / 40

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

15 / 40

15.

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

16 / 40

16. Python is an interpreted programming language

17 / 40

17.

What will the below Python code will return?

If str1="save paper,save plants"str1.find("save")

A. It returns the first index position of the first occurance of “save” in the given string str1.
B. It returns the last index position of the last occurance of “save” in the given string str1.
C. It returns the last index position of the first occurance of “save” in the given string str1.
D. It returns the first index position of the first occurance of “save” in the given string str1.

18 / 40

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

19 / 40

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

20 / 40

20. Extension of all Python  Programme are .py

21 / 40

21. Python relies on indentation?

22 / 40

22.

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

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

23 / 40

23.

What will be the output of above Python code?

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

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

24 / 40

24.

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

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

25 / 40

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

26 / 40

26. Which of the following character is used to give single-line comments in Python?
a) //
b) #
c) !
d) /*

27 / 40

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

28 / 40

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

29 / 40

29.

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

a. 2

b. 3

c. 5

d. Multiple times

30 / 40

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

31 / 40

31. All keywords in Python are in _________
a) Capitalized
b) lower case
c) UPPER CASE
d) None of the mentioned

32 / 40

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

33 / 40

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

34 / 40

34. Python can connect to database systems.

35 / 40

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

36 / 40

36.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

37 / 40

37. Who developed Python Programming Language?

38 / 40

38. Variable names are case-sensitive

39 / 40

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

40 / 40

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

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.