HELP! Python!!

Define a function named dice_odds that returns a dictionary with possible sums between two 6-face dice as
keys and a list of all combinations (tuples) as values.

&

Define a 'recursive' function named 'geometric_sequence' that takes three integers as follows
i - first element
r - ratio
n - an integer for target position
and returns the nth element in this sequence. You are required to use memoization to speed up
the computation. Your code should not be limited to the following parameters

>>>> geometric_sequence(3, 2, 5)
48

Answers

Answer 1

Using the knowledge in computational language in python it is possible to write a code that the Define a 'recursive' function named geometric_sequence' that takes three integers

Writting the code:

def num_list(sides, count):

   modified_list = []

   for i in range(count):

       #appends the same list as many times as is called for

       modified_list += list(range(1, sides + 1))

   return modified_list

mem = {}

def geometric_sequence(i, r, n):

   if n == 1:

       mem[n] = i

   if n not in mem:

       mem[n] = r * geometric_sequence(i, r, n - 1)

   return mem[n]

See more about python at brainly.com/question/12975450

#SPJ1

HELP! Python!!Define A Function Named Dice_odds That Returns A Dictionary With Possible Sums Between

Related Questions

When a person’s personal information is collected by other parties, it refers to the issue of_______.

Answers

Answer:

The answer should be privacy

Explanation:

Answer: it refers to the issue of version control privacy personality so

The answer should be privacy

Explanation:

Your Word Document Requirements
Part 1: Name: your name

Part 2: Data Source: the source of your data (do not copy and paste your data into the Word document)

Part 3: Questions to Answer: the questions your analysis will answer

Part 4: The Plan: the pseudocode outline of your program

Part 5: Plan Feedback from Your Partner: suggestions from your partner

Part 5: Results: copy and pasted results from your data file

Part 6: Interpretation: your interpretation of the results

Part 7: Final Feedback from Your Partner: description of what your partner found interesting

You can use this rubric

to evaluate your project before you submit it.
What to Submit
You will submit each of the following.

A Word document: Organize it as shown below.
Your data file: Saved with a .txt extension
Your program: Saved with a .txt extension since you cannot upload a .py file.
Your results file: Saved with a .txt extension.

Answers

Using the knowledge in computational language in python it is possible to write a code that the pseudocode outline of your program;

Writting the code:

import sys

import os

def main():

   # Check and retrieve command-line arguments

   if len(sys.argv) != 3:

       print(__doc__)

       sys.exit(1)   # Return a non-zero value to indicate abnormal termination

   fileIn  = sys.argv[1]

   fileOut = sys.argv[2]

   # Verify source file

   if not os.path.isfile(fileIn):

       print("error: {} does not exist".format(fileIn))

       sys.exit(1)

   # Verify destination file

   if os.path.isfile(fileOut):

       print("{} exists. Override (y/n)?".format(fileOut))

       reply = input().strip().lower()

       if reply[0] != 'y':

          sys.exit(1)

   # Process the file line-by-line

   with open(fileIn, 'r') as fpIn, open(fileOut, 'w') as fpOut:

       lineNumber = 0

       for line in fpIn:

           lineNumber += 1

           line = line.rstrip()   # Strip trailing spaces and newline

           fpOut.write("{}: {}\n".format(lineNumber, line))

           # Need \n, which will be translated to platform-dependent newline

       print("Number of lines: {}\n".format(lineNumber))

if __name__ == '__main__':

   main()

See more about python at brainly.com/question/12975450

#SPJ1

you want to identify all devices on a network along with a list of open ports on those devices. you want the results displayed in a graphical diagram. which tool should you use?

Answers

Since you want to identify all devices on a network along with a list of open ports on those devices. you want the results displayed in a graphical diagram. the tool that you use is Port scanner.

Why would someone use a port scanner?

Finding open ports on a network that might be receiving or transferring data is a process called port scanning. In order to find vulnerabilities, it also entails sending packets to particular ports on a host and examining the answers.

Note that Only when used with a residential home network or when specifically approved by the destination host and/or network are network probing or port scanning tools allowed. Any kind of unauthorized port scanning is absolutely forbidden.

Learn more about Port scanner from

https://brainly.com/question/28147402
#SPJ1

What are examples of scanning devices?

Answers

Here the examples of scanning devices :

Drum Scanner.Handheld Scanner.Flatbed Scanner.Optical Character Recognition.Magnetic Ink Character Recognition.Image Scanner.

What is meant by scanning ?A text is scanned quickly in order to find a specific piece of information. In daily life, scanning is regularly used for tasks like looking up a word in a dictionary or finding a friend's name in your phone's contacts list.Scanners may basically be divided into three categories. These consist of network scanning, port scanning, and vulnerability scanning.There are three different types of scanners: portable scanners, flatbed scanners, and drum scanners. While flatbed scanners are commonly used in offices and classrooms, drum scanners are mainly used in the publishing industry to print high-quality pictures.Three processes make up the basic scanning process: scan, register, and detail.

Learn more about scanning refer to :

https://brainly.com/question/25106178

#SPJ4

What is the difference between an MRI scan and a CT scan?

Answers

Answer:

MRI doesn’t use radiation CT does

Explanation:

Why is MRI considered safer than CT?

Answers

Answer: MRIs don't use any radiation

Explanation:

Define network and list 5 components of a typical network setup

Answers

A network consists of two or more computers that are linked in order to share resources is called network
Any 5 components of typical network setup are
1) Clients
2)Servers
3)Channels
4)interface devices
5)Operating systems

What happens if I replace my router?

Answers

If you replace your router you can get faster speeds, improved range, and new features.

Could the routers just be replaced?There are a number of convincing reasons to substitute your own router in its place, including the following: A new router might offer a better and more stable connection.Just unplug, take out, and set up the new router. To do this, connect an Ethernet cable from the router to the modem and modify the network name and password as usual.You may often choose between purchasing a box that includes both a modem and a router separately from your Internet service provider. You may use any option to access the Internet. Know that if you purchase a combo device and one part malfunctions (such as the modem or router).

To learn more about router refer to:

https://brainly.com/question/24812743

#SPJ4

are there any other types of technology that can attach to satellites and assist it in data collection?

Answers

Yes, there are other types of technology that can attach to satellites and assist it in data collection.

What is the term used to describe satellite data collection?

The practice of remote sensing involves gathering knowledge about things, places, or phenomena from a distance, usually from planes or satellites. It entails the detection and classification of objects on the Earth's surface, in the atmosphere, and in the oceans using sensor technologies based on satellite or aircraft.

Therefore, Remote sensing methods like optical imaging and synthetic-aperture radar are used to gather satellite imagery data. They collect data and send it to earth.

Learn more about data collection from

https://brainly.com/question/26711803
#SPJ1

Other Questions
Marlene used the Distributive Property to find the product of 6 and 0.82. Which expression shows the Distributive Property? how to clean and sanitize in a three compartment sink quiz sheet an object rolls without slipping onto a surface where the coefficient of friction between object and surface is twice as great as that needed to prevent slipping. part a describe the subsequent motion. Identify the appositive in the following sentence.She looked forward to her favorite activity, jogging on the beach, after she finished her work.jogging on the beachafter she finished her workShe looked forward to her favorite activity feminist criticism sparknotes When an integer is subtracted from 8 times the next consecutive even integer, the difference is 86. Find the value of the greater integer. How does the government protect the public? QUESTION 8Which of the following debunks the Lost Cause myth that the South seceded because of state's rights and not to protect slavery?a. President Woodrow Wilson, president of the U.S. during WWI and former president of Princeton, wrote about the central role that slavery played.b. The films Birth of a Nation and Gone with the Wind are so powerful that they persuade people to believe that the war was over slavery.c. Lincoln's Declaration of War, in which he clearly blamed the South's desire to keep slaves as a cause of the war.d. The Declarations of Secession by the Southern States, which explained that slavery was central to why they were leaving the United States.QUESTION 9How did the Lost Cause myth become so popular, even though it wasn't true?a. The Daughters of the Confederacy were influential on school boards for decades, and so were able to choose student textbooks that promoted the Lost Cause.b. Popular movies like Birth of a Nation and Gone with the Wind were able to sway many, especially with the romanticized scenes in Gone with the Wind.c. The Daughters of the Confederacy had statues erected in honor of Confederate soldiers; these statues along with Confederate Veteran memorials promoted the idea of the good soldier without mention of the causes or consequences of the war.d. All of the above.QUESTION 10Which of the following was a major reason that England did not intervene in the American Civil War?a. Britain ignored the American conflict, and so it never considered getting involved in the American Civil War.b. Britain did not want to lose the South as a trading part since it imported cotton, which was needed for its textile mills.c. Lincoln's Emancipation Proclamation (1863) turned the war into a crusade against slavery, which the British people could not support, even though Britain had been leaning in favor of the Confederacy. how many epistles does the third group of Pauls letters contain? please hurry. Byron works at stich-rite clothing factory. The company is required to maintain safe working conditions under the. according to economic liberals, what is the role of the state in international economics? Use the discriminant to determine how many and what kind of solutions the quadratic equation 2x^2 - 4x = -2 has. Please explain how you got the solution.20 Points! Thanks! What are the steps in the naturalization process ? Dr. Angie Debo's work, including books like The Rise and Fall of the Choctaw Republic, centered on exposing the worldtoA. The African American experience in America's citiesB. The popularization of American Indian art in EuropeC. The American Indian perspective on westward expansionD. The differences between contemporary and traditional ways of life What is (-i)6?O A. -iOB. iO C. 1O D. -1 What is the best method of disease control? During the paleolithic era, early humans were primarily __________ and __________. A. Hunters. . . Gatherers b. Farmers. . . Fishermen c. Hunters. . . Fishermen d. Farmers. . . Gatherers please select the best answer from the choices provided a b c d. which of the following is the recommended aerobic exercise intensity for an individual with chronic kidney disease? Find the coordinates of any points of intersection between the graphs of y = x^2 4x + 2 and y = -x^2 8x Which product would be considered part of the business-to-business market? Multiple Choice classes at a university for a college freshman O pens and pencils for that student O books for the class members O a computer for the instructor to use while teaching the class The four activities that are part of the marketing process are also referred to as the Multiple Choice marketing concept. O product mix. selling concept. marketing mix.