"Simon Says" is a memory game where "Simon" outputs a sequence of 10 characters (R, G, B, Y) and the user must repeat the sequence. Create a for loop that compares the two strings. For each match, add one point to user_score. Upon a mismatch, end the game.
Sample output with inputs: 'RRGBRYYBGY' 'RRGBBRYBGY'
User score: 4
in python please

Answers

Answer 1

import random

letters=["R", "G", "B", "Y"]

i = 0

to_guess = ""

while i < 10:

   to_guess += random.choice(letters)

   i += 1

print("Simon says "+to_guess)

user_score = 0

user = input()

for x in range(0, len(to_guess)):

   try:

       if user[x] == to_guess[x]:

           user_score += 1

       else:

           break

   except IndexError:

       break

print("User score: "+str(user_score))

I hope this helps!

Answer 2

Answer:

import random

validletters=["R", "G", "B", "Y"]

input1 = ""

for i in range(1,11):

     input1 = input1 + random.choice(validletters)

input2 = input("Input String 2: ")

if len(input2) != 10:

     print("Invalid Length")

else:

     user_score = 0

     for i in range(0,10):

           if(input1[i] == input2[i]):

                 user_score = user_score + 1

           else:

                 break

     print("String: "+input1)

     print("Guess: "+input2)

     print("User Score: "+str(user_score))

Explanation:

The code assumes that user input will always be R, G, B or Y

The next two lines get two string user inputs

import random

This lists the valid letters

validletters=["R", "G", "B", "Y"]

This initializes an empty string

input1 = ""

The following iteration generates the input string of 10 characters

for i in range(1,11):

     input1 = input1 + random.choice(validletters)

This prompts user for input string

input2 = input("Input String 2: ")

This checks if input string is up to length of 10

if len(input2) != 10:

If yes, it prints invalid length

     print("Invalid Length")

else:

If otherwise, user_score is initialized to 0

     user_score = 0

The following iteration checks for matching characters in both strings

     for i in range(0,10):

           if(input1[i] == input2[i]):

                 user_score = user_score + 1  This increments user_score by 1 if there is a match

           else:

                 break  This ends the program if there is no match

The next three lines print the strings and the user score

     print("String: "+input1)

     print("Guess: "+input2)

     print("User Score: "+str(user_score))


Related Questions

Harry has created a Microsoft Excel workbook that he wants only certain people to be able to open. He should use
on the File tab to set a password for the workbook.
Encrypt with Password
Save with Password
Open with Password
Set Password
NEXT QUESTION
ASK FOR HELP
TURN IT IN

Answers

Answer:

Encrypt with password

why am I doing the investigation?​

Answers

Answer:

What do you mean

Explanation:

Answer:

Because you like to

Explanation:

write query for all products reutrn product name with its amounts due, paid, canceled, and refunded, order the result by product name ascending

Answers

Answer:

SELECT product_name, amount_due, amount_paid,

              cancelled, amount_refunded

   FROM products

ORDER BY product_name ASC;

Explanation:

SQL (Structured Query Language ) was used above.

The SELECT command is used to list all the variables we want in our output.

The FROM command signifies the location.

ORDER BY command ensures that your result is ordered

ASC means Ascending Order.

; signifies the end of the query.

NOTE: Underscores were used because variables cannot be written with spaces between them

Match the data types to the types of value they are: Currency, Text, Date/time, and Name.
$500-
10th January 2015-
56,654.09-
Sample.1234-

Answers

$500- Currency
10th January 2015- Date/time
56,654.09- Number
Sample.1234- Text

When you pass an array name as an argument to the function what is actually being passed

Answers

Answer:

The Base address of the array is being passed

Guess The Lyrics:
She like the way that I ______
She Like The Way That I _____
She Like The Way That I ______
She Like The Way That I

Answers

she like the way that i *DANCE*
she like the way that i *MOVE*
she like the way that i *ROCK*
she like the way i *WOO*

song : DIOR pop smoke

Answer:

Explanation:

She like the way that I _Dance_____She Like The Way That I __Move___She Like The Way That I ___Rock___She Like The Way That I Woo

Your computer is taking longer than usual to open files and you notice that your hard drive light stays on longer than usual which of the following is a possible solution to counteract this one and install any recently added Southward and review to ensure that the recycle bin is empty clear Internet history and cookies and remove any unused files for the desktop three defrag the hard drive or four change the computer power settings to minimal

Answers

Answer:

Clear out unused files

Explanation:

The reason whay the hard drive is so slow is probably because it full of junk. The recycle bin, old update files, cached data, etc. can easily fill up the hard drive, thus slowing it down.

What size segment will be allocated for a 39 KB request on a system using the Buddy system for kernel memory allocation?A) 42 KB.B) 64 KB.C) 39 KB.D) None of the above.

Answers

Answer:

B

Explanation:

64kb

Identify and summarize the three types of programs that can be installed on a computer running Windows.

Answers

Types of Programs

There are two categories of programs. Application programs (usually called just "applications") are programs that people use to get their work done. Computers exist because people want to run these programs. Systems programs keep the hardware and software running together smoothly. The difference between "application program" and "system program" is fuzzy. Often it is more a matter of marketing than of logic.

The most important systems program is the operating system. The operating system is always present when a computer is running. It coordinates the operation of the other hardware and software components of the computer system. The operating system is responsible for starting up application programs, running them, and managing the resources that they need. When an application program is running, the operating system manages the details of the hardware for it. For example, when you type characters on the keyboard, the operating system determines which application program they are intended for and does the work of getting them there.

Some embedded systems do not use an operating system, but run their programs directly on the processor.

Modern operating systems for desktop computers come with a user interface that enables users to easily interact with application programs (and with the operating system itself) by using windows, buttons, menus, icons, the mouse, and the keyboard. Examples of operating systems are Unix, Linux, Android, Mac OS, and windows

Using the constant, declare a 1D array to store 10 integers ii. Write a loop that fills the array with 10 random numbers g

Answers

Answer:

Following are the code to this question:

#include <iostream>//defining header file

#include <cstdlib>//defining header file

using namespace std;

int main()//defining main method

{

const int ax[10]={1,2,3,4,5,6,7,8,9,10};//defining a const array ax that store 10 numbers

int r_num[10];//defining an array r_num

int i;//defining integer variable

for(i=0;i<10;i++)//defining for loop to calculate and store random numbers in array

{

   r_num[i]=rand()%100; //use rand function to store value in array

}

cout<<"Elements of the array that stores 10 random numbers: "<<endl;//print message

for(i=0;i<10;i++)//defining for loop for print array value

{

   cout<<r_num[i]<<endl;//print array value

}

return 0;

}

Output:

Elements of the array that stores 10 random numbers:  

83

86

77

15

93

35

86

92

49

21

Explanation:

In the above-given program, two arrays "ax, and r_num" is declared that store value in it, in which the ax array use the const keyword and in the r_num it uses the loop and random function which can be defined as follows:

In the second array "r_num", two for loop is declared, in which the first loop uses the rand function to store value in the array, and in the second array, it prints the value of the array.


When do you use online reading tools? Check all that apply.
when there is a word that I do not know how to pronounce
when the text is in a language that I do not fully understand
o when I need to know the meaning of a word
O O O O
O when there are main ideas or details I want to take notes on
when there is information in my reading that I want to look up quickly

Answers

Answer:

the answers are all of them

Answer:

A, B, C, D, E, F

Explanation:

It's any of them. There is no wrong answer.

Got right, on warm up! Hope this helps.

i have been looking for like 20 mins now and cant find the answers to test 3 on edhesive. does anybody have an clue to where i can find it? it is a 20 question test.

Answers

Answer:

Try looking it up. If not, go with your gut!

Write a nested loop that prints the following output.
1
1 2 1
1 2 4 2 1
1 2 4 8 4 2 1
1 2 4 8 16 8 4 2 1
1 2 4 8 16 32 16 8 4 2 1
1 2 4 8 16 32 64 32 16 8 4 2 1
1 2 4 8 16 32 64 128 64 32 16 8 4 2 1

Answers

Answer:

Written in Python:

rows = 8

for i in range(1,rows+1):

      for j in range(1,rows):

             print(" ")

      x = 1

      for j in range(1,i):

             print(str(x)+" ",end='')

             x = int(x*2)

      while x >= 1:

             print(str(x)+" ",end='')

             x = int(x/2)

Explanation:

For each row, the print out is divided into two parts.

1. Starts from 1 and ascends to a peak

2. Then descends from the peak to 1

This line initializes the number of rows to 0

rows = 8

This iterates from 1 to the number of rows

for i in range(1,rows+1):

This prints a blank at the end of sequence printed on each line

      for j in range(1,rows):

             print(" ")

This initializes each row element to 1

      x = 1

This iterates the number of item to print on each line depending on the row

      for j in range(1,i):

This prints the row element in ascending order to the peak

             print(str(x)+" ",end='')

This calculates the next element to be printed

             x = int(x*2)

This checks for valid row element to print in descending order to 1

      while x >= 1:

             print(str(x)+" ",end='')

             x = int(x/2)

Stacy is generating a report for her database. Which of these statements is true about her database reports?
OA. To generate a report will include all her records in her database
OB. The generator report will include all records that a query fetches
OC. Once you generate a report she cannot edit it
OD. A report in itself another database on which she can run queries

Answers

The answer is OB. The generated report will include all records that a query fetches.

For interface and dialogue designs, one additional subsection is included: a section outlining the dialogue sequence which is ________.
A) The ways a user moves from one display to another
B) A narrative overview
C) A sample design
D) Testing and usability assessment

Answers

Answer:

A) The ways a user moves from one display to another

Explanation:

The interface is the point of interconnection between a user and a system. On the other hand, the dialogue shows the sequence of interactions between a user and a system. In the dialogue section, computation is formatted just like paper-based forms. So, for interface and dialogue designs, one additional subsection is included: a section outlining the dialogue sequence which is The ways a user moves from one display to another.

This additional subsection shows how the user is shifted from one screen to another screen or can say it as " moves from one display to another" and it is carried out for dialogue design and outlining dialogue sequence.

please complete the spelling please tell fast.​

Answers

Answer:

spacebar and number i think

Explanation:

Answer:

b)ans might be number.........

Which of the following represented an inch in ancient civilizations?

length from the forefinger tip to its first joint
length from the thumb tip to its first joint
width of a lady’s thumb
width of a forefinger

Answers

Answer:it’s the first one

Explanation:

What is the purpose of application software (software that is not part of the operating system or utilities)?
A. The set of minimal instructions that allows your computer to load the operating system
B. Software that coordinates the working of the pieces of the system unit (firmware and hardware)
C. Programs that the user manipulates to accomplish computer-related tasks ..

Answers

Answer:

c

Explanation:

Programs that the user manipulates to accomplish computer-related tasks is the purpose of application software. Hence, option C is correct.

What is application software?

Application software is a category of computer program that carries out particular business, educational, and personal tasks. Every program is made to help users do a range of tasks, some of which might be connected to productivity, creativity, or communication.

The computer programs we use on a daily basis are the most prevalent examples of application software. This software package comes with Microsoft Office, PowerPoint, Word, Excel, Outlook, and more. Software for music applications like Pandora and Spotify.

Application software comes in a wide variety of forms, such as open source, freeware, shareware, and licensed software. Application software can be installed or run online.

Thus, option C is correct.

For more details about Application software, click here:

https://brainly.com/question/14612162

#SPJ2

here's a better picture of my pc mouse and keyboard​

Answers

Answer:ok

Explanation:

Answer:

what r ue grades

Explanation:

Which word or phrase refers to an increasingly common method of computing and storing files?

A.
Virtual downloads

B.
Outsourcing

C.
Digital technologies

D.
Cloud computing

Answers

The answer is Cloud computing
Hope this helps-

Answer:

cloud computing

Explanation:

You are implementing a RAID storage system and have found a system with eight 100 GB drives. How much storage space will you have available? How does the OS handle this RAID?

Answers

Answer:

The space available will vary between 800 GB (100%) and 400 GB (50%) of the total disks, depending on the RAID level.

The OS will handle the RAID as a single disk.

Explanation:

Each RAID level implements parity and redundancy in a different way, so the amount of disks used for this extra information will reduce the space available for actual storage.

Usual RAID levels are:

RAID 0: does not implement any redundancy or parity, so you will have available 100% of the total storage: 8 x 100 GB = 800 GB

RAID 1: Duplicates all the information in one disk to a second disk. Space is reduced in half: 400 GB

RAID 5: Uses the equivalent of 1 disk of parity data distributed evenly on each disk, meaning the space available is [tex]\frac{n-1}{n}[/tex] of the total disks: [tex]\frac{7}{8}[/tex] of 800 GB = 700 GB

Writting and reading the information on a RAID storage is handled by a raid controller, either implemented in hardware or software. The OS will "see" a single disk and will read or write information as usual.

Define the missing function. licenseNum is created as: (100000 * customID) licenseYear, where customID is a function parameter. Sample output with inputs 2014 777: Dog license: 77702014

Answers

Answer:

Written in Python:

def licenseNum(licenseYear, customID):

    output = 100000 * customID + licenseYear

    print("Dog license: "+str(output))

 

Explanation:

This line defines the function with parameters licenseYear and customID

def licenseNum(licenseYear, customID):

This calculates the output as stated in the question

    output = 100000 * customID + licenseYear

This displays the output

    print("Dog license: "+str(output))

To call the function, make use of: licenseNum(2014, 777)

Where 2014 and 777 can be replaced with other digits as required

Answer: C++

void DogLicense:: CreateLicenseNum(int customID)   {

 

  licenseNum = (100000* customID) + licenseYear;

 

  return;

}

What do you expect the future trends of an operating system in terms of, cost, size, multitasking, portability, simplicity

Answers

Answer:

Size

Explanation:

thats it thats the answer

The network team has well established procedures to follow for creating new rules on the firewall. This includes having approval from a manager prior to implementing any new rules. While reviewing the firewall configuration you notice a recently implemented rule but can't locate manager approval for it. What would be a good step to have in the procedures for a situation like this

Answers

Answer:

hello your question has missing options below are the missing options

A. Monitor all traffic using the firewall rule until a manager car) approve it.

B. Immediately roll back the firewall rule until a manager can approve it

C. Don't roll back the firewall rule as the business may be relying upon it, but try to get manager approval as soon as possible.

D. Have the network team document the reason why the rule was implemented without prior manager approval.

answer : Don't roll back the firewall rule as the business may be relying upon it, but try to get manager approval as soon as possible. ( C )

Explanation:

A good step to have in the procedures of a situation like this is

Don't roll back the firewall rule as the business may be relying upon it, but try to get manager approval as soon as possible.

In a network that uses distance-vector routing protocols, what information is included in the update sent out by each router?

Answers

Answer:

Network or next hop associations

Explanation:

In a network that uses distance-vector routing protocols, the information that is included in the update sent out by each router is "network or next hop associations."

This information is contained in a routing table. It commands a router on which destination is most favorable. It is done by carrying the packet to a certain router that indicates the next hop along the way to the last destination.

In a network that uses distance-vector routing protocols, the information that is included in the update sent out by each router is the network or next hop association.

A distance-vector routing protocol in data networks is vital for determining the best route for the packets that are based on the distance.

It should be noted that distance-vector routing protocol simply measures the distance based on the number of routers that a packet will have to pass. The information that is vital will be the network or next hop association.

Read related link on:

https://brainly.com/question/20595433

how many earths fit in a sun

Answers

My Answer:

1.3 million Earths.

The answer is that it would take 1.3 million Earths to fill up the Sun. It would take so much Earths to fill the Sun because the Sun makes up 99.86% of the mass of the Solar System, so a lot of Earths would be needed to fill up the Sun.

- Elianie ✨

What is the median of 6, 16, 9, 20, 45, 30, and 32?
A. 9
B. 16
C. 20
D. 22

Answers

I believe the answer to your question is going to be C. 20
Hope this helps:)

Create a statement that always returns the names of the three criminals with the highest number of crimes committed.

Answers

Answer:

SELECT TOP 3 crimes_committed FROM criminals_and_crimes

Explanation:

Assuming the questions requires an SQL statement, we need to order the list of the criminals by the number of crimes committed.

Let's assume the criminal names are stored under criminal_name and number of crimes committed is stored under num_of_crimes in a list named criminals_and_crimes

We can write:

SELECT TOP 3 crimes_committed FROM criminals_and_crimes

for MySQL.

I hope this answer helps.

please choose odd one out please tell fast​

Answers

Answer: arrow key

Explanation:

Some airports are installing face recognition systems to identify terrorists and criminals trying to enter the country. Statistics show that about one in one million people passing through the airports is a terrorist. Suppose the FAR is about 1 percent. The FRR is about 30 percent. Assume there are 10 million terminal visitors (i.e., people entering the country) at all country's airports. Based on the information provided, calculate the number of terrorists attempting to get in the country through airports, the number of terrorists that would be identified, the number of daily legitimate passengers, the number of passengers incorrectly identified as terrorists. Report your answers to the following table. Note: Some of the numbers are given to you in the exercise. You just need to report them to the table. Number of Terminal visitors FRR FAR Number of Terrorists Number of Terrorists identified Number of Legitimate passengers Number of Passengers incorrectly identified

Answers

Answer and Explanation:

Given the table,

Number of Terminal visitors:

FRR:

FAR:

Number of Terrorists:

Number of Terrorists identified:

Number of Legitimate passengers: Number of Passengers incorrectly identified:

We fill the table,

Number of Terminal visitors: 10,000,000

FRR: 3,000,000

FAR: 100,000

Number of Terrorists: 10

Number of Terrorists identified: 3,000,010

Number of Legitimate passengers: 9,999,990

Number of Passengers incorrectly identified: 3,100,000

Number of passengers incorrectly identified as terrorists : 3,000,000

Note:

1. Number of terminal passengers is 10 million from question(number of passengers entering the country from all airports in the country)

2. The False Rejection Rate(FRR) is the rate of rejection of authorised passengers by the biometric system. It is 30% here. We calculate 0.30*10 million= 3 million

3. False Acceptance Rate(FAR) is the rate of acceptance of unauthorized passengers by the biometric. It is 1% here. We calculate 0.01*10 million= 100000

4. Number of Terrorists is equal to 10 since one in one million people are terrorists. 10 million people would then have 10 terrorists.

5. Number of Terrorists identified: number of terrorists would be number of falsely identified terrorists 3 million + number of terrorists 10 = 3,000,010 ( assuming that all terrorists were identified)

6. Number of Legitimate passengers: number of legitimate passengers = 10 million passengers- number of terrorists 10= 9,999,990

7. Number of Passengers incorrectly identified: number of passengers incorrectly identified is equal to falsely rejected passengers(FRR) 3 million + falsely accepted passengers 100000= 3,100,000

8. Number of passengers incorrectly identified as terrorists is equal to falsely rejected passengers (FRR) =3,000,000

Other Questions
The Northwest Ordinance, portrayed above, established which of the following provisions?answer choices : A It prohibited Americans to settle north of the Ohio River B It set up a process to survey and sell the lands north of the Ohio RiverC It allowed Native Americans to take control of the Northwest Territory and establish new territoriesD It allowed French citizens to move into the territory to establish fur trading routes What are some examples of someones culture? a. Religion b. Gender c. Race d. County of Origin e. Languages f. All of the above g. None of the above Do this for me thank you !!! Ill mark you as brainliest Your family got an awesome Black Friday deal on 85 inch big screen TV for $800. This was 60% off the original price? How much was the original price? Which points are reflections of each other across both axes? A coordinate plane. (2, 8) and (2, 8) (7, 1) and (7, 1) (5, 6) and (5, 6) (4, 3) and (3, 4) In baseball, a batting average is recorded to 3 decimal places, such as 0.301. This means 301 hits outs of 1 000 times at bat. How many hits in 100 times at bat would you expect each player to get? What is the slope of this line? A tornado destroyed many CORRECT ANSWER GETS BRAINLIEST PLEASE HELP !structures in a small Texas town. Which type of engineer should be called in to collectevidence in order to prevent this level of damage in the future?A.chemical engineerB.biomedical engineerC.materials engineerD.forensic engineer Points and Brainliest Giveaway!What is the simplified form?(2x^2 + 3x) + (4x^2 -7) Henry David Thoreau best reflects transcendentalist Ideas whta time is it for u??? You are traveling in a car and you want to know how long it will take you to reach your destination. You will travel 220 miles at an average speed of 55 miles per hour. Use the distance formula D=rt , to determine how much time, t, in hours it will take you to get there degree of polynomial x^2+2xy+y^2 HELP WILL MAKE YOU A BRAINLEST!!! What will most likely cause a lender to approve credit? (5 points)A historic credit score of 500Most payments paid on timeA large amount of debt owedA long credit history with high balances 1. What is an electronic health record? How does it compare to an electronic medicalrecord? (2 points) Help. Pls............... :/Il give brainliest Help me out I need this pleaseeee ILL GIVE BRAINLIST Explain how you might go from gallons to cups using more than one conversion factor. Plzzzzz help ASAP 50 points for the answer4. Explain the differences between case studies, case histories, and case problems.