Answer:
B. string -> (int -> int)
Explanation:
We are going to perform comparison operations '->'. It is important to notice that the comparison operation gives us a bool value (True or False) and the comparison operation is legal if and only if the data types to be compared are the same.
Example:
int(4)->int(5) False
int(4)->int(4) True
int(4)->string(4) Error, data types don't match
For this reason:
- A. Is legal because float -> float evaluates to True, True is a boolean value and bool -> bool is legal because both are the same data type.
- B. Is illegal because int -> int evaluates to True, True is a boolean value and string is not a boolean (string -> bool).
- C. Is legal because int is the same type than int.
- D. Is legal because the list is the same type than list regardless it's content.
Note:
The operations inside parentheses are evaluated first.
List is a type by itself regardless of its content.
Answer:
7
Explanation:
Given the codes as follows:
- j = i = 1
- i += j + j * 5
- print("What is i?", i)
In line 1, the value of 1 is assigned to variable i and then the variable i is assigned to variable j. This means j will hold the value of 1 as well.
In line 2, j will be multiplied with 5 prior to the addition with j itself. So, j + j * 5 -> 1 + (1 * 5) -> 1 + 5 -> 6
Next, value of 6 will be added with i. i = i + 6 -> i = 1 + 6 -> 7#
Eventually, value of 7 will be printed out (Line 3).
an application that distributes messages to subscribers on an electronic mailing list.
A.True theres answer hope it helped