[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 for function?
a) Fun
b) Define
c) Def
d) Function

2 / 40

2. Strings in python are surrounded by either single quotation marks, or double quotation marks

3 / 40

3.

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.

4 / 40

4. Variable names are case-sensitive

5 / 40

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

6 / 40

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

7 / 40

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

8 / 40

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

9 / 40

9. Comparison operators are not  used to compare two values

10 / 40

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

11 / 40

11. Python allows you to extract the values into variables.

12 / 40

12.

What will be the output of below Python code?

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

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

13 / 40

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

14 / 40

14.

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

a. [ ]

b. { }

c. ( )

d. None of the above

15 / 40

15.

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.

16 / 40

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

17 / 40

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

18 / 40

18. A variable name must start with a letter or the underscore character

19 / 40

19. Python can be install on both  Linux and  Windows

20 / 40

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

21 / 40

21. Arithmetic operators are used with numeric values to perform common mathematical operations

22 / 40

22.

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

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

23 / 40

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

24 / 40

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

25 / 40

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

26 / 40

26. Python relies on indentation?

27 / 40

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

28 / 40

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

29 / 40

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

30 / 40

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

a. 5

b. 3

c. 6

d. 7

31 / 40

31.

l = [ 4, 8, 9, 2.6, 5 ] is a type of which data type in python?

  1. List
  2. Tuple
  3. Set
  4. None of these

32 / 40

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

33 / 40

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

34 / 40

34. Which of the following is used to define a block of code in Python language?
a) Indentation
b) Key
c) Brackets
d) All of the mentioned

35 / 40

35.

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

36 / 40

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

37 / 40

37. Most recent major version of Python is Python 3

38 / 40

38.

Which of the following statement will execute in last?

def s(n1): #Statement 1      print(n1) #Statement 2n2=4 #Statement 3s(n2) #Statement 4

a. Statement 1

b. Statement 2

c. Statement 3

d. Statement 4

39 / 40

39. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

40 / 40

40. What is the output of the given below program?

if 1 + 3 == 7:    print("Hello")else:    print("Know Program")

a) Hello
b) Know Program
c) Compiled Successfully, No Output.
d) Error

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.