[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

2. Variable names are case-sensitive

3 / 40

3.

What will be the output of below Python code?

tupl=([2,3],"abc",0,9)tupl[0][1]=1print(tupl)A. ([2,3],"abc",0,9)B. ([1,3],"abc",0,9)C. ([2,1],"abc",0,9)D. Error

4 / 40

4. The list’s remove() method only removes the first occurrence of the specified value.

5 / 40

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

6 / 40

6.

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

7 / 40

7.

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.

8 / 40

8. Python relies on indentation?

9 / 40

9. Which of the following is the use of function in python?
a) Functions are reusable pieces of programs
b) Functions don’t provide better modularity for your application
c) you can’t also create your own functions
d) All of the mentioned

10 / 40

10. Python is a  high-level programming language.

11 / 40

11.

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

a. [ ]

b. { }

c. ( )

d. None of the above

12 / 40

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

13 / 40

13. Python is an interpreted programming language

14 / 40

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

15 / 40

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

16 / 40

16. You can also use the remove() method to remove an element from the array

17 / 40

17. Comparison operators are not  used to compare two values

18 / 40

18. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

19 / 40

19.

What do we use to define a block of code in Python language?

  1. Key
  2. Brackets
  3. Indentation
  4. None of these

20 / 40

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

21 / 40

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

22 / 40

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

a. 5

b. 3

c. 6

d. 7

23 / 40

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

24 / 40

24.

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

25 / 40

25.

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

26 / 40

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

27 / 40

27.

What is the value of the expression 100 / 25?

  1. 4
  2. 4.0
  3. 0
  4. 25

28 / 40

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

29 / 40

29.

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

a. 2

b. 3

c. 5

d. Multiple times

30 / 40

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

31 / 40

31. Who developed Python Programming Language?

32 / 40

32. The elif keyword is pythons way of saying “if the previous conditions were not true, then try this condition”.

33 / 40

33.

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

34 / 40

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

35 / 40

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

36 / 40

36. What will be the output of the following Python code?

x = ['ab', 'cd']for i in x:    i.upper()print(x)

a) [‘ab’, ‘cd’]
b) [‘AB’, ‘CD’]
c) [None, None]
d) none of the mentioned

37 / 40

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

38 / 40

38.

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

a. Define

b. DEF

c. def

d. Def

39 / 40

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

40 / 40

40.

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.

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.