1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
antiseptic1488 [7]
2 years ago
8

Python 4.11 LAB: Number pattern Write a recursive function called print_num_pattern() to output the following number pattern. Gi

ven a positive integer as input (Ex: 12), subtract another positive integer (Ex: 3) continually until 0 or a negative value is reached, and then continually add the second integer until the first integer is again reached.
Input: 12
3

Output: 12 9 6 3 0 3 6 9 12
Computers and Technology
1 answer:
Stella [2.4K]2 years ago
3 0

Answer:

def print_num_pattern(num1,num2):

   if (num1 <= 0):  

       print(num1, end = ' ')  

       return

   print(num1, end = ' ')

   print_num_pattern(num1 - num2, num2)

   print(num1, end = ' ')

print_num_pattern(12,3)

Explanation:

You might be interested in
A merge is _____.
Aliun [14]
The process of combining information from a variety of sources
7 0
3 years ago
Read 2 more answers
Write a program that get
densk [106]

Answer:

people = list(map(int, input().split()))  # gets input and makes them into an integer

for i in range(len(people)):

   if 0 <= people[i] <= 5:

       print('Baby')  # You didn't specify how you want to 'store' the info, but I'm just going to print it out

   elif 6 <= people[i] <= 17:

       print('Teen')

   elif 18 <= people[i]:

       print('Adults')

Explanation:

This is the basic structure of the code. This is written in Python 3x. If you are writing in a different language, then just use the template given to you!

5 0
3 years ago
Complete the statement below using the correct term.
julia-pushkina [17]

Answer:

im pretty sure it is the implementation phase. But i can't be too sure about it.

5 0
3 years ago
Many of the internal OS services are provided by the ___________ module, which contains the most important operating system proc
patriot [66]

Answer:

Kernal module

Explanation:

Modules are pieces of code that can be loaded and unloaded into the kernel upon demand. They extend the functionality of the kernel without the need to reboot the system.

6 0
4 years ago
A network with 10 bits remaining for the host portion will have how many usable host addresses?
makvit [3.9K]

Answer:

2^10 = 1024 addresses

Explanation:

Each bit can be either 1 or 0, and this holds true for all 10 bits. So for every bit, we choose either a 0 or a 1 (2 choices), and then do so for the remaining bits. So we have 2 * 2 * 2 * ... * 2 (10 2's) choices for all 10 bits

8 0
3 years ago
Other questions:
  • Look at the code in the example below, and then answer the question. In the example code, what does the title attribute create?
    12·2 answers
  • 4. The clutch pedal is found in cars with manual and automatic transmissions.
    6·1 answer
  • With a two-dimensional array, the ____ field holds the number of rows in the array.
    6·1 answer
  • Is an important and necessary step that precedes object-oriented programming?
    6·1 answer
  • The width of a strand of fiber is 19.2 micrometers. if 1500 strands are adhered side by side, how wide would the resulting fabri
    9·1 answer
  • Given an int variable n that has already been declared and initialized to a positive value, and another int variable j that has
    9·1 answer
  • Many contemporary languages allow two kinds of comments: one in which delimiters are used on both ends (multiple-line comments),
    7·1 answer
  • What does input allow a computer to do
    14·1 answer
  • what is the term for software that is exclusively controlled by a company, and cannot be used or modified without permission?
    6·1 answer
  • Need help with Python coding from Zybooks...
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!