[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

2.

Which statement is correct?

A. List is immutable && Tuple is mutable
B. List is mutable && Tuple is immutable
C. Both are Mutable.
D. Both are Immutable

3 / 40

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

4 / 40

4.

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.

5 / 40

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

6 / 40

6. Python is a  high-level programming language.

7 / 40

7. Variable names are case-sensitive

8 / 40

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

9 / 40

9.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

10 / 40

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

11 / 40

11.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

12 / 40

12. python file can also run on command line

13 / 40

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

14 / 40

14.

 What is output of: 35 == 35.0

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

15 / 40

15.

Which is the correct operator for power(xy)?

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

16 / 40

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

17 / 40

17. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

18 / 40

18.

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

19 / 40

19. Comparison operators are not  used to compare two values

20 / 40

20.

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

21 / 40

21. Extension of all Python  Programme are .py

22 / 40

22. Python can be install on both  Linux and  Windows

23 / 40

23. A for loop is used for iterating over a sequence (that is either a list, a tuple, a dictionary, a set, or a string).

24 / 40

24.

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

a. 2

b. 3

c. 5

d. Multiple times

25 / 40

25. Python is an interpreted programming language

26 / 40

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

27 / 40

27. To insert characters that are illegal in a string, use an escape character

28 / 40

28.

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

a. Define

b. DEF

c. def

d. Def

29 / 40

29.

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

30 / 40

30.

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

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

31 / 40

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

32 / 40

32.

What will be the output of above Python code?

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

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

33 / 40

33.

Which of the following is False?

A. String is immutable.
B. capitalize() function in string is used to return a string by converting the whole given string into uppercase.
C. lower() function in string is used to return a string by converting the whole given string into lowercase.
D. None of these.

34 / 40

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

35 / 40

35.

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

a. True

b. False

36 / 40

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

37 / 40

37.

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.

38 / 40

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

39 / 40

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

40 / 40

40.

How to copy one list to another in python?

A. l1[] = l2[]
B. l1[] = l2
C. l1[] = l2[:]
D. l1 = l2

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.