[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

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

2 / 40

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

3 / 40

3. You can also have an else without the elif

4 / 40

4.

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

5 / 40

5. Comments can’t be used to prevent execution when testing code.

6 / 40

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

7 / 40

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

8 / 40

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

9 / 40

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

10 / 40

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

11 / 40

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

a. 5

b. 3

c. 6

d. 7

12 / 40

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

13 / 40

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

14 / 40

14.

Which of the following is not a keyword in Python language?

  1. val
  2. raise
  3. try
  4. with

15 / 40

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

16 / 40

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

17 / 40

17. python has two primitive loop commands:

  • while loops
  • for loops

18 / 40

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

19 / 40

19. Which of the following is False regarding loops in Python?

a)Loops are used to perform certain tasks repeatedly.

b) while loop is used when multiple statements are to executed repeatedly until the given condition becomes true.

c) while loop is used when multiple statements are to executed repeatedly until the given condition becomes false.

d) for loop can be used to iterate through the elements of lists.

20 / 40

20.

Which of the following precedence order is correct in Python?

  1. Parentheses, Exponential, Multiplication, Division, Addition, Subtraction
  2. Multiplication, Division, Addition, Subtraction, Parentheses, Exponential
  3. Division, Multiplication, Addition, Subtraction, Parentheses, Exponential
  4. Exponential, Parentheses, Multiplication, Division, Addition, Subtraction

21 / 40

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

22 / 40

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

23 / 40

23. Which of the following loop is not supported by the python programming language?

a) for loop

b) while loop

c) do…while loop

d) None of the above

24 / 40

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

25 / 40

25.

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

26 / 40

26. Which of the following is a Python tuple?
a) [1, 2, 3]
b) (1, 2, 3)
c) {1, 2, 3}
d) {}

27 / 40

27. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

28 / 40

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

29 / 40

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

30 / 40

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

31 / 40

31.

What is the value of the expression 100 / 25?

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

32 / 40

32.

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.

33 / 40

33. Most recent major version of Python is Python 3

34 / 40

34.

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

35 / 40

35. Camel Case
Each word, except the first, starts with a capital letter:

36 / 40

36.

Which function overloads the >> operator?

  1. more()
  2. gt()
  3. ge()
  4. None of the above

37 / 40

37. Pascal Case
Each word starts with a capital letter:

38 / 40

38.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

39 / 40

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

40 / 40

40. Python relies on indentation?

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.