[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

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

3 / 40

3.

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

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

4 / 40

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

5 / 40

5.

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

a. [ ]

b. { }

c. ( )

d. None of the above

6 / 40

6.

 Select the correct example of complex datatype in Python

  1. 3 + 2j
  2. -100j
  3. 5j
  4. All of the above are correct

7 / 40

7. Which term describes a loop that continues repeating without a terminating (ending) condition?

a) Infinite Loop

b) Conditional Loop

c) Unlimited Loop

d) Sequence Loop

8 / 40

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

9 / 40

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

10 / 40

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

a. 5

b. 3

c. 6

d. 7

11 / 40

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

12 / 40

12. The format() method takes the passed arguments

13 / 40

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

14 / 40

14.

How to copy one list to another in python?

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

15 / 40

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

16 / 40

16.

 What is output of: 35 == 35.0

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

17 / 40

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

18 / 40

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

19 / 40

19. Python is a  high-level programming language.

20 / 40

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

21 / 40

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

22 / 40

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

23 / 40

23. Comments can be used to explain Python code.

24 / 40

24. Python has various versions available

25 / 40

25.

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.

26 / 40

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

27 / 40

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

28 / 40

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

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. An array can hold many values under a single name

31 / 40

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

32 / 40

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

33 / 40

33. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

34 / 40

34. Most recent major version of Python is Python 3

35 / 40

35. Comments starts with a #

36 / 40

36.

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

37 / 40

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

38 / 40

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

39 / 40

39. You can use the pop() method to remove an element from the array

40 / 40

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

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.