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
a_sh-v [17]
3 years ago
15

Write a recursive function called DrawTriangle() that outputs lines of '*' to form a right side up isosceles triangle. Function

DrawTriangle() has one parameter, an integer representing the base length of the triangle. Assume the base length is always odd and less than 20. Output 9 spaces before the first '*' on the first line for correct formatting.
Computers and Technology
1 answer:
lorasvet [3.4K]3 years ago
4 0

Answer:

Code:-  

# function to print the pattern

def draw_triangle(n, num):

     

   # base case

   if (n == 0):

       return;

   print_space(n - 1);

   print_asterisk(num - n + 1);

   print("");

 

   # recursively calling pattern()

   pattern(n - 1, num);

   

# function to print spaces

def print_space(space):

     

   # base case

   if (space == 0):

       return;

   print(" ", end = "");

 

   # recursively calling print_space()

   print_space(space - 1);

 

# function to print asterisks

def print_asterisk(asterisk):

     

   # base case

   if(asterisk == 0):

       return;

   print("* ", end = "");

 

   # recursively calling asterisk()

   print_asterisk(asterisk - 1);

   

# Driver Code

n = 19;

draw_triangle(n, n);

Output:-  

# Driver Code n = 19;| draw_triangle(n, n);

You might be interested in
Accessibility is the degree to which a product or service is readily available and usable by _____.
I am Lyosha [343]

Answer:

A-As many people as possible

3 0
2 years ago
If you want to distribute a formatted Microsoft word document to people who don't have word save it as a __file
Helga [31]
If you want them only to read it and not change it send as a .pdf else I would send as a .txt file. Hope that helps
5 0
3 years ago
Which of the following clauses of the UPDATE command is optional? (Points : 2) UPDATE
Scorpion4ik [409]

Answer:

FROM.

Explanation:

UPDATE table

SET column=value,column1=value1,.....

WHERE condition;

In the UPDATE command given in the question FROM is optional because when using UPDATE we already mention the table name with update look at the syntax above.So there is no need to again mention the table name in FROM.All other three are required that is UPDATE,SET,WHERE.

6 0
4 years ago
A user of Augmented Reality is able to experience<br> of information on their surroundings.
Margarita [4]

Explanation:

A combination of our normal sense of the objects around us with an overlay of information displayed. Blurs the line between what's real and what's computer-generated by enhancing what we see, hear, feel and smell. Augmented reality is the integration of digital information with the user's environment in real time. Unlike virtual reality, which creates a totally artificial environment, augmented reality uses the existing environment and overlays new information on top of it.

Ex: projecting a phone pad to your hand, and Pokemon Go,

7 0
3 years ago
JAVA When simply determining the order of magnitude of an algorithm using Big-Oh algorithm analysis, an instruction that evaluat
OlgaM077 [116]

Answer:

True.

Explanation:

When determining the order of magnitude of an algorithm using the Big-Oh algorithm analysis.The instruction which evaluates to O(c) is equal to one that is O(1) because it is considered as constant time and to represent constant we use O(1) in  big-Oh notation.

Hence the answer to this question is True.

7 0
3 years ago
Other questions:
  • Very often in data science, we are interested in understanding how values change with time. Use np.diff and np.max (or just max)
    13·1 answer
  • Which of the following are important for protecting computing devices and systems? Physical safeguards like a secure space prote
    7·1 answer
  • Why should you avoid the use of sarcasm , cliches, and idioms in business letters?
    6·2 answers
  • Write a program that include a method that returns the sum of all the elements of a Linked List of Integers. Allow the user to e
    11·1 answer
  • The gradual wearing away or breaking down of rocks by abrasion is a type of __________________ weathering.
    8·1 answer
  • Consider the following code: x = 9 y = -2 z = 2 print (x + y * z) What is output? 9 13 14 5
    5·1 answer
  • Drag each label to the correct location on the image.
    7·1 answer
  • What are the determinants of price elasticity of demand?​
    11·2 answers
  • What data type would you use for a decimal number?* ​
    9·1 answer
  • Becca is working on a program that will store data. The program will need quick access to data and data persistence is not impor
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!