[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. Comments starts with a #

2 / 40

2. The format() method takes the passed arguments

3 / 40

3.

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.

4 / 40

4.

What will be the output of below Python code?

str1="Information"print(str1[2:8])

A. format
B. formatio
C. orma
D. ormat

5 / 40

5. break in Python is used ______________

a) To restart a loop

b) Terminate a loop

c) To jump in between the loop

d) None of the above

6 / 40

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

7 / 40

7.

 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.

8 / 40

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

9 / 40

9. You can return a range of characters by using the slice syntax

10 / 40

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

11 / 40

11.

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

12 / 40

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

13 / 40

13. Python relies on indentation?

14 / 40

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

15 / 40

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

16 / 40

16.

 ____________________ can be defined as a named group of instructions that accomplish a specific task when it is invoked/called.

a. Function

b. Datatype

c. Token

d. Operator

17 / 40

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

18 / 40

18.

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.

19 / 40

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

20 / 40

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

21 / 40

21.

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

22 / 40

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

23 / 40

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

24 / 40

24.

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

25 / 40

25. Variables that are created outside of a function

26 / 40

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

27 / 40

27.

Which function overloads the >> operator?

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

28 / 40

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

29 / 40

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

30 / 40

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

31 / 40

31.

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

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

32 / 40

32. Most recent major version of Python is Python 3

33 / 40

33. An example of an illegal character is a double quote inside a string that is surrounded by double quotes

34 / 40

34. Comparison operators are not  used to compare two values

35 / 40

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

36 / 40

36.

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

37 / 40

37. Python is an interpreted programming language

38 / 40

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

39 / 40

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

40 / 40

40. You can also have an else without the elif

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.