[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

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

a. Define

b. DEF

c. def

d. Def

2 / 40

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

3 / 40

3.

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.

4 / 40

4. Python is a  high-level programming language.

5 / 40

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

6 / 40

6.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

7 / 40

7.

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

8 / 40

8. Python has a set of built-in methods that you can use on lists/arrays

9 / 40

9. Extension of all Python  Programme are .py

10 / 40

10.

The function can be called in the program by writing function name followed by ____

a. [ ]

b. { }

c. ( )

d. None of the above

11 / 40

11. Operators are used to perform operations on variables and values

12 / 40

12.

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

13 / 40

13.

How to copy one list to another in python?

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

14 / 40

14. Who developed Python Programming Language?

15 / 40

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

16 / 40

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

17 / 40

17. Suppose t = (1, 2, 4, 3), which of the following is incorrect?
a) print(t[3])
b) t[3] = 45
c) print(max(t))
d) print(len(t))

18 / 40

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

19 / 40

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

20 / 40

20. python has two primitive loop commands:

  • while loops
  • for loops

21 / 40

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

22 / 40

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

23 / 40

23. Python can connect to database systems.

24 / 40

24. Python can be install on both  Linux and  Windows

25 / 40

25. The else keyword catches anything which isn’t caught by the preceding conditions.

26 / 40

26. Python is an interpreted programming language

27 / 40

27. python file can also run on command line

28 / 40

28.

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.

29 / 40

29.

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.

30 / 40

30.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

31 / 40

31. Comments can be used to make the code more readable.

32 / 40

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

33 / 40

33.

 ____________________ can be defined as a named group of instructions that accomplish a specific task when it is invoked/called.

a. Function

b. Datatype

c. Token

d. Operator

34 / 40

34. Comments can be used to explain Python code.

35 / 40

35.

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

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

36 / 40

36. Most recent major version of Python is Python 3

37 / 40

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

38 / 40

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

39 / 40

39. print() function is often used to output variables.

40 / 40

40.

 What is output of: 35 == 35.0

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

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.