Answer:
ababababab
Explanation:
The code above is written in python and python uses indentation .So let me rephrase the code accordingly and explain what the code really do.
Note x and y is a global variable which can be used by any of the function declared. According to the question x and y are 2 and 3 respectively
The first block of code describes a function f1 without any argument but the code should return the string "ab"
def f1():
return "ab"
The second block of code defines a function f2 and returns the value of f1 multiply by x. This means you are multiplying the string "ab" by 2 which will be equals to abab
def f2():
return f1() * x
The third block of code declared a function f3 and returns the sum of f2 and product of f1 and y. using PEMDAS principle the multiplication aspect will be solved first so, ab × 3 = ababab, then we add it to f2 . ababab + abab = ababababab.
def f3():
return f2() + f1() * y
Finally, we print the function f3 value to get ababababab
print(f3())
If you run the code on your IDE like below you will get ababababab
x = 2
y = 3
def f1():
return "ab"
def f2():
return f1() * x
def f3():
return f2() + f1() * y
print(f3())
Answer:
1000 500 250 125 the output
Explanation:
write a program using integers userNum and x as input, userNum divided by
x four times. EX : If the input is 2000 2 the output is 1000 500 250 125
Answer:
True.
Explanation:
An investigator would like to do an internet-based college student survey to gather data regarding their behavior as well as drug use. Even so, specific identifications are still not gathered and IP addresses might be available in the set of data. Damage threat must be assessed both by the magnitude (or severity) and the likelihood (or likelihood) of the hurt.
Answer:
Following are the code in c language
#include <stdio.h> // header file
int main() // main function
{
int n1,i;
float avg,x,s=0; // variable declaration
printf("\nEnter How many Number terms you want:");
scanf("%d",&n1); // input terms by user
for(i=0;i<n1;++i)
{
scanf("%f",&x); // user input
s= s +x; //calculate sum
}
avg = s/n1;// calculate average of n number
printf("\nThe average of n number is:");
printf("%f",avg); // display average
return 0;
}
Output
Enter How many Number terms you want:3
3
4
3
The average of n number is:3.333333