Answer:
Following are the program in the Python Programming language.
#define function
def negative_num(num_list):
#set list type variable
nlist=[]
#set the for loop
for n in num_list:
#check negative numbers
if(n<0):
#add the value of n in list
nlist.append(n)
#return list
return nlist
#set new list type variable that store list
newl=[-5,8,-6,3,-4,9,-7]
#print and call the function
print(negative_num(newl))
<u>Output</u>:
[-5, -6, -4, -7]
Explanation:
Here, we define the function "negative_num" and pass an argument "num_list" in its parameter and inside the function.
- Set new list data type variable "nlist".
- Set the for loop which iterate as the list.
- Set the if conditional statement to check the value of the list is less than 0 then, add that negative values in the variable "nlist".
- Then, return the new list.
Finally, we set a variable "newl" which store the list of negative and positive numbers then, we print and call the function.
Answer:
I'm sure that she used deductive reasoning to make the assumption that there were people injured. So the answer is b
Answer:hypertext transfer protocol secure
Explanation:
Answer:
Written in C++
The statement that prints the required output is:
<em>printMessage(favFood);
</em>
Explanation:
The full program is with comment is:
#include<iostream>
using namespace std;
//The method begins here
void printMessage(string favFood){
//This line prints the required output
cout<<favFood<<"_is_great";
}
//The main method starts here
int main()
{
//This line declares favFood as string
string favFood;
//This line prompts user for input
cout<<"Food: ";
//This line gets the input
cin>>favFood;
//This line calls the printMessage method
printMessage(favFood);
return 0;
}