D. using cell phones in a work place. when cell phones came out with apps and games people started paying more attention to the social media apps and their games then their own job, hope this helps :)
Answer:
- import sys
-
- def fibonacci(n):
- if(n == 0 or n == 1):
- return n
- else:
- return fibonacci(n - 2) + fibonacci(n-1)
-
- num = int(sys.argv)
- output = ""
-
- for i in range(1, num+1):
- output += str(fibonacci(i)) + " "
-
- print(output)
Explanation:
Firstly, we import sys module as we need to accepts n as command line argument (Line 1).
Next, create a function fibonacci takes take one input n (Line 3). If the n is zero or one, return the n itself (Line 4-5). Otherwise, the program shall run the recursive call to the fibonacci function itself by putting n-2 and n-1 as function argument, respectively (Line 6-7).
After that, use the sys.argv to get the command line argument and assign the value to num (Line 9).
Use a for loop to generate the output string by progressively calling the fibonacci function and join the return result to the output string (Line 12-13).
At last print the output string (Line 15).
To take a screen shot press the 'prt scn' button
stands for print screen. this screen shot is then put in the clipboard for pasting
Photo shop because you can add any thing or create any thing you want
Answer:
class Main {
public static void main(String args[]) {
for(int i=0; i<6;i++) {
for(int j=0;j<i+1;j++) {
System.out.printf("%d ",2*i+1+2*j);
}
System.out.println();
}
}
}
Explanation:
You will need two nested loops for sure.
For the exact assignments of variables, many flavors of the solution exist, this is just one possible option.