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
PilotLPTM [1.2K]
3 years ago
9

Computer programming 2

Computers and Technology
1 answer:
yarga [219]3 years ago
6 0
Here is the second photo

You might be interested in
What's your fav show?
mezya [45]

Answer:

<h3>ITS DEPENDS IF I'M INTERESTED</h3>

Explanation:

HBU?^_________^

6 0
3 years ago
Read 2 more answers
WhyTheCombOfNatashaOtomoskiHas21Teeth?.txt
mash [69]

What is the question?

6 0
3 years ago
Suppose a package pkg1 contains a class named MyClass and another package pkg2 contains a different class named MyClass. What ha
pogonyaev

Answer:

Following are the solution to this question:

Explanation:

In this question, two packages "pkg1 and pkg2" is defined, that hold a class that is "MyClass", in which the class name is the same. If we import the package so, it can't import both classes in the very same file. If we really need to apply to both, then must completely specify one class name, and in the class name is different so, we simply use both classes by creating the instance.  

7 0
3 years ago
What are the limitations of the ASCII character set? State why it is limited in this way?
dedylja [7]
The problem with ASCII or extended ASCII is that the ASCII system can only represent up to 128 (or 256 for EASCII) different characters. The limitation on the number of character sets means representing character sets for several different language structures is not possible.
7 0
3 years ago
Write a function called 'game_of_eights()' that accepts a list of numbers as an argument and then returns 'True' if two consecut
MrRa [10]

Answer:

In Python:

def main():

   n = int(input("List items: "))

   mylist = []

   for i in range(n):

       listitem = input(", ")

       if listitem.isdecimal() == True:

           mylist.append(int(listitem))

       else:

           mylist.append(listitem)

   print(game_of_eights(mylist))

def game_of_eights(mylist):

   retVal = "False"

   intOnly = True

   for i in range(len(mylist)):

       if isinstance(mylist[i],int) == False:

           intOnly=False

           retVal = "Please, enter only integers"

       if(intOnly == True):

           for i in range(len(mylist)-1):

               if mylist[i] == 8 and mylist[i+1]==8:

                   retVal = "True"

                   break

   return retVal

if __name__ == "__main__":

   main()

Explanation:

The main begins here

def main():

This gets the number of list items from the user

   n = int(input("List items: "))

This declares an empty list

   mylist = []

This iterates through the number of list items

   for i in range(n):

This gets input for each list item, separated by comma

       listitem = input(", ")

Checks for string and integer input before inserting item into the list

<em>        if listitem.isdecimal() == True:</em>

<em>            mylist.append(int(listitem))</em>

<em>        else:</em>

<em>            mylist.append(listitem)</em>

This calls the game_of_eights function

   print(game_of_eights(mylist))

The game_of_eights function begins here

def game_of_eights(mylist):

This initializes the return value to false

   retVal = "False"

This initializes a boolean variable to true

   intOnly = True

This following iteration checks if the list contains integers only

   for i in range(len(mylist)):

If no, the boolean variable is set to false and the return value is set to "integer only"

<em>        if isinstance(mylist[i],int) == False:</em>

<em>            intOnly=False</em>

<em>            retVal = "Please, enter only integers"</em>

This is executed if the integer contains only integers

       if(intOnly == True):

Iterate through the list

           for i in range(len(mylist)-1):

If consecutive 8's is found, update the return variable to True

<em>                if mylist[i] == 8 and mylist[i+1]==8:</em>

<em>                    retVal = "True"</em>

<em>                    break</em>

This returns either True, False or Integer only

   return retVal

This calls the main method

if __name__ == "__main__":

   main()

7 0
3 years ago
Other questions:
  • What's the difference in unicode value between 'e' and 'a'? (consult a table of unicode values):?
    7·1 answer
  • Paragraph: Read the following two e-mail messages. In three to five sentences, explain why E-mail B is the more appropriate work
    5·1 answer
  • ________-generation languages use symbols and commands to help programmers tell the computer what to do.
    11·2 answers
  • Andrew wants to create a website for his college. Which web-based programming language should he use?
    11·2 answers
  • When evaluating portable CD players, you consider price, the sound quality, and ease of using the controls. These are your _____
    8·2 answers
  • Can some please help me learn how to make a program via Binary Code?
    7·1 answer
  • The growing network of physical objects that will have sensors connected to the Internet is referred to as the ________.
    13·1 answer
  • Who knows my sister better?
    15·2 answers
  • Select the correct answer from each drop-down menu. What is a distribution list and how is it selected?
    5·1 answer
  • In java complete a program that takes a weight in kilograms as input, converts the weight to pounds, and then outputs the weight
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!