Hello, your answer is ready.
Answer: A) True
Best of luck!
~
Your pal papaguy
What are the type groups?
Answer:
Written using Python 3:
<em>num1 = int(input("Enter first value: "))
</em>
<em>num2 = int(input("Enter second value: "))
</em>
<em>
</em>
<em>finalResult =(num1+num2) / 3
</em>
<em>print("Answer is: ", finalResult)</em>
<em />
INPUT:
Enter first value: 4
Enter second value: 5
OUTPUT:
Answer is: 3
Explanation:
First step is to declare the variables:
Second is to ask for an input:
- input("Enter first value: ")
Then we need to convert them into integers by encapsulating the line above inside int(). This is a requirement before you can do any mathematical operations with the given values.
- num1 = int(input("Enter first value: "))
Next is to calculate:
- <em>finalResult </em><em>=(num1+num2) / 3
</em>
- Here we first add the values of num1 and num2, <em>then </em>divide the sum by 3.
And to test if the output is correct, let us print it:
- <em>print("Answer is: "</em><em>,</em><em> </em><em>finalResult</em><em>)</em>
- print() - when used for strings/texts, use quotation marks like: "text here"
- but when used to print variables and numbers (integers, floats, etc), there is no need to enclose them with quotation marks.
- to concatenate string and an integer (in this case the variable finalResult), simply add a comma right after the string.
<em />
Answer:
Explanation:
The following code is written in Python and is a simple function that removes all of the type String elements within the list that has been passed as an argument. Then finally, prints out the list and returns it to the user.
def filter_out_str(list):
for x in list:
if type(x) == type(" "):
list.remove(x)
print(list)
return list