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
HELP WILL MARK BRAINLIEST!!!!!!!!!!!!!!!!!<br> How do you take a screenshot on Windows 7?
Alina [70]
U can see the printscr botton at the top right of ur keyboard and then u can type paint and the control v. 
3 0
3 years ago
Read 2 more answers
Decribe the components of an Microsoft<br>Windows desktop<br>​
damaskus [11]

Explanation:

the main component of Windows when you start your computer are the desktop, my computer, recycle bin , start button, Taskbar and shortcuts to application after opening an application you will also have a Windows with an active application which will appear in your desktop and taskbar.

3 0
3 years ago
Angela's ready to get started with her first Smart Display campaign, but her account isn't yet eligible due to not having enough
Kisachek [45]

Answer:

At least 50 conversions on Display or at least 100 conversions on Search

Explanation:

Smart Display Campaigns by Google provides an intelligent and simply solution to help manage the complexities of display advertising, and is regarded as the easiest way to increase customer base and conversions. In order to set up a Smart Display Campaign, go to the Campaign tab in Google Adwords and go ahead to click on "create a new display campaign". It is important to be aware that to be eligible to run this solution, you are expected to have at least 50 conversions on display or 100 conversions on Search in the last 30 days.

3 0
4 years ago
I'm in need of an answer im not just wasting points for your benefit anymore..
faltersainse [42]

Answer:

i would say A, to me it just makes sense

Explanation:

3 0
3 years ago
Which phrase defines the term “Internet”?
lions [1.4K]
It's either B or D... I believe it is B.
8 0
3 years ago
Read 2 more answers
Other questions:
  • Describe a situation involving making a copy of a computer program or an entertainment file of some sort for which you think it
    7·1 answer
  • HURRY
    5·1 answer
  • How can touch typing quickly but accurately improve your earnings (the money you can make)
    15·2 answers
  • Why Is Jarvis Banned For Life? Literally Don't need to be forever!
    9·1 answer
  • What is one way to measure technological progress?
    5·1 answer
  • The MAA is responsible on a daily basis to protect office computers and patient records and personal information from hackers. R
    12·1 answer
  • You load an image file into a numpy array and look at its shape, which is (433, 650). What does this indicate?
    13·1 answer
  • graham drove 39 2/3 miles in 1 1/3 hours. What is the unit rate for miles per hour? Use a pencile and paper. Describe a situatio
    10·1 answer
  • Favorite color should it be stored why?or why not?<br>​
    6·1 answer
  • What is malware? What are some signs that malware may be impacting the performance of your computer? How can you avoid malware?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!