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
Maslowich
3 years ago
11

Write a grammar for the language consisting of strings that have n copies of the letter a followed by the same number of copies

of the letter b and the the same number of copies of the letter c, where n >0. For example, the strings abc, aaaabbbbcccc, and aaaaaaaabbbbbbbbcccccccc are in the language but a, abbc, bac, and aaabbbcc are not
Computers and Technology
1 answer:
Mazyrski [523]3 years ago
7 0

Answer:

def language(mystring, n):

   if n > 0:

       string_list = [x for x in mystring]

       string_cont = ""

       for character in string_list:

           string_cont += character * n

       print(string_cont)

Explanation:

When n is equal to 0, that is, n=0, The python program multiplies the characters of the string "mystring" by the integer variable "n" to output a string with all characters with the same count.

You might be interested in
Which of the following commands would you use to start the program Main with four strings? a. java Main arg0 arg1 arg2 arg3 b. j
kirill [66]

Answer:

The answer is a. java Main arg0 arg1 arg2 arg3

Explanation:

The strings here are called command line argument. These command line arguments allow you to run your program from your terminal/command line. You may think just like passing parameters to a function. Since you have four strings in your program, you need to pass four arguments.

5 0
4 years ago
Throughout the lecture, the teacher speaks about the defintion of "Science"
Arlecino [84]

Answer:

I would say A. Since that is pretty much the Scientific Method.

Explanation:

Yeah

8 0
3 years ago
Read 2 more answers
Which feature does the web designer fail to apply in this layout for a web page? A. harmony
iogann1982 [59]
The answer is D.balance
3 0
3 years ago
Read 2 more answers
DO YOU EVER FEEL LIKE A PLASTIC<br> DRIFTING THROUGH THE WIND, WANTING TO START AGAIN
Anna35 [415]

Answer:

what exactly is the question because I don't see anything

4 0
3 years ago
Read 2 more answers
Why are large commercial companies interested in developing mobile apps for smartphones?
loris [4]
Because they can make a lot of money if they create a popular application.
7 0
3 years ago
Other questions:
  • Tanya is entering the amount of money she has earned from babysitting onto an Excel spreadsheet, but the AutoComplete feature is
    9·2 answers
  • 1. How do you answer questions that require you to draw inferences? (1 point)
    7·2 answers
  • What is the process called if you are erasing data on your hard drive from a MAC
    12·1 answer
  • 50 pts. please help ! Explain briefly the role, responsibilities, and required background of the production designer of a film.
    12·1 answer
  • Need help with this
    12·1 answer
  • QUICK! The commands available from a menu change depending upon what you are doing. True False
    10·2 answers
  • What do you mean by algorithm​
    9·2 answers
  • Which function would you use to make sure all names are prepared for a mailing label? TODAY UPPER PROPER LOWER
    11·1 answer
  • What are different sheet icons
    5·1 answer
  • Which UPPER function is written so that all text in cell B4 will be capitalized? O=UPPER(B4) O=UPPER[B4] O UPPER B4 O=UPPER
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!