[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

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.

2 / 40

2. Comments starts with a #

3 / 40

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

4 / 40

4.

 Which of the following statement is False?

  1. Variable names can be arbitrarily long.
  2. They can contain both letters and numbers.
  3. Variable name can begin with underscore.
  4. Variable name can begin with number.

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.

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.

7 / 40

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

8 / 40

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

9 / 40

9. The format() method takes unlimited number of arguments

10 / 40

10. Extension of all Python  Programme are .py

11 / 40

11.

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

12 / 40

12.

What will be the output of above Python code?

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

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

13 / 40

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

14 / 40

14. Comparison operators are not  used to compare two values

15 / 40

15. Arrays are used to store multiple values in one single variable.

16 / 40

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

17 / 40

17. With the break statement we can stop the loop even if the while condition is true

18 / 40

18. Is there any comments in  following codes

i = 1while True:    if i%3 == 0:        break    print(i)     i + = 1

 

19 / 40

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

20 / 40

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

a. 5

b. 3

c. 6

d. 7

21 / 40

21.

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

22 / 40

22. Most recent major version of Python is Python 3

23 / 40

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

24 / 40

24.

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

25 / 40

25. + operator is used  to get output of multiple variables

26 / 40

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

27 / 40

27. X wants to allow the program to repeatedly ask the user to enter their Choice if it does not equal the Answer. Which loop option should X use?

a) while Choice == Answer:

Choice = input()

b) while Choice != Answer:

Choice = input()

c) while Answer != Choice:

Choice = input()

d) while Answer =! Choice:

Choice = input()

 

28 / 40

28. Variable names are case-sensitive

29 / 40

29. Find the output of the given Python program?

a, b, c = 1, 3, 5if a > 0:  if b < 2:    print("Hi")  elif c > 3:    print("Hello")else:  print("Know Program")

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

30 / 40

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

31 / 40

31.

How to copy one list to another in python?

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

32 / 40

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

33 / 40

33.

 Select the correct example of complex datatype in Python

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

34 / 40

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

35 / 40

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

36 / 40

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

37 / 40

37.

Choose the correct option with respect to Python.

A. Both tuples and lists are immutable.
B. Tuples are immutable while lists are mutable.
C. Both tuples and lists are mutable.
D. Tuples are mutable while lists are immutable.

38 / 40

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

39 / 40

39. Python  was created by Guido van Rossum, and released in 1999.

40 / 40

40. Who developed Python Programming Language?

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.