Answer:
- def getLargest(number_list):
- new_list = []
-
- for x in number_list:
- if(isinstance(x, int)):
- new_list.append(x)
-
- largest = max(new_list)
-
- return largest
Explanation:
Firstly, create a function <em>getLargest()</em> that take one input parameter, <em>number_list</em>.
The function will filter out the float type number from the list by using <em>isinstance() </em>method (Line 5). This method will check if a current x value is an integer. If so, the x value will be added to <em>new_list</em>.
Next, use Python built-in <em>max</em> function to get the largest integer from the <em>new_list </em>and return it as output.
Answer:
Plan the script, characters, and how the game is played
Answer: False
Explanation:
The statement that "Peacekeeper text is non-printing text that indicates where you can type" is false.
The non-printing text which shows where on exam type is referred to as the peaceholder text. It is usually an hint which can be used to fill in the actual text.
Answer:
The program in Python is as follows:
num1 = int(input())
num2 = int(input())
if num1 >=0 and num2 >= 0:
print(num1+num2)
elif num1 <0 and num2 < 0:
print(num1*num2)
else:
if num1>=0:
print(num1**2)
else:
print(num2**2)
Explanation:
This gets input for both numbers
num1 = int(input())
num2 = int(input())
If both are positive, the sum is calculated and printed
<em>if num1 >=0 and num2 >= 0:</em>
<em> print(num1+num2)</em>
If both are negative, the products is calculated and printed
<em>elif num1 <0 and num2 < 0:</em>
<em> print(num1*num2)</em>
If only one of them is positive
else:
Calculate and print the square of num1 if positive
<em> if num1>=0:</em>
<em> print(num1**2)</em>
Calculate and print the square of num2 if positive
<em> else:</em>
<em> print(num2**2)</em>