[SOLVED] need help with python

I’m stuck on a Python question and need an explanation.

Struggling to find relevant content or pressed for time? – Don’t worry, we have a team of professionals to help you on
[SOLVED] need help with python
Get a 15% Discount on this Paper
Order Now

Overview

This lab reviews previous concepts involving loops.

Python Functions and Scripts

Write and test Python functions for each of the following. When writing a function, include a docstring.

  1. Implement the function color_gallery that takes as a parameter a list of strings, each indicating a browser-compliant color. The function should generate and display a web page that shows all pair-wise combinations of colors from the list. Your generated page should have appropriate text labels for each displayed color. The actual formatting is up to you, provided that it’s reasonable.
  2. Craps is a dice-based game played in many casinos. Like blackjack, a player plays against the house. The game starts with the player throwing a pair of standard, six-sided die. If the player rolls a total of 7 or 11 in the first round, the player wins. If the player rolls a total of 2, 3, or 12 in the first round, the player loses. For all other roll values, the player must roll again to determine whether he/she has won or lost. In the second and subsequent rounds the player rolls the pair of dice again. If the player matches the roll value from the first round again, he/she wins. If the player rolls a 7, he/she loses. Play continues into another round until the initial roll is matched (for a win) or a 7 is rolled (for a loss).
    1. Write a function craps that takes no parameters, simulates one game of craps, and returns 1 if the player won and 0 if the player lost. It should also print a history of the rolls so that the player can verify that the function is doing the right thing.
    2. Next modify craps by adding an optional parameter to it so that craps(True) produces the print output but that craps(False) does not. If it is called without a parameter, it should behave as described in the previous part (i.e. make its default value set to True). Finally, write a new function called quietCraps that doesn’t take any argments and simply returns 0 or 1 without the print results. The quietCraps function should simply make an appropriate call to craps.
    3. Finally, implement a function testCraps that takes a positive integer n as a parameter, simulates n games of craps using the quietCraps function, and returns the fraction of games the player won. The function must call the quietCraps function.

    PLEASE LOOK at the Attachment follow the format.

Calculate the price
Make an order in advance and get the best price
Pages (550 words)
$0.00
*Price with a welcome 15% discount applied.
Pro tip: If you want to save more money and pay the lowest price, you need to set a more extended deadline.
We know how difficult it is to be a student these days. That's why our prices are one of the most affordable on the market, and there are no hidden fees.

Instead, we offer bonuses, discounts, and free services to make your experience outstanding.
Sign up, place your order, and leave the rest to our professional paper writers in less than 2 minutes.
step 1
Upload assignment instructions
Fill out the order form and provide paper details. You can even attach screenshots or add additional instructions later. If something is not clear or missing, the writer will contact you for clarification.
s
Get personalized services with MyCoursebay
One writer for all your papers
You can select one writer for all your papers. This option enhances the consistency in the quality of your assignments. Select your preferred writer from the list of writers who have handledf your previous assignments
Same paper from different writers
Are you ordering the same assignment for a friend? You can get the same paper from different writers. The goal is to produce 100% unique and original papers
Copy of sources used
Our homework writers will provide you with copies of sources used on your request. Just add the option when plaing your order
What our partners say about us
We appreciate every review and are always looking for ways to grow. See what other students think about our do my paper service.
Nursing
Thank you. Well done
Customer 452881, October 22nd, 2023
Other
Excellent
Customer 452813, September 11th, 2024
Social Work and Human Services
Awesome Work!
Customer 452587, October 20th, 2021
ENVIRONMENT SCIENCE
great
Customer 452813, June 26th, 2022
Education
Thank you so much for all the help, I really appreciate it!
Customer 452631, November 3rd, 2021
Marketing
Thanks so much for your service and as always. I’ll get back with you soon!
Customer 452909, March 29th, 2024
Technology
Excelled job on the paper!
Customer 452885, December 28th, 2022
IT, Web
Don did an excellent job!!!
Customer 452885, January 25th, 2023
Nursing
Paid for the paper to be completed 5 days prior than the day I received the paper.
Customer 452693, July 13th, 2022
Human Resources Management (HRM)
This paper is well -written from what I have read. If there are any instructor concerns, I will advise.
Customer 452701, October 24th, 2023
Human Resources Management (HRM)
Dynamic!!
Customer 452701, October 17th, 2023
Nursing
Looks good. Thank you!!
Customer 452525, April 27th, 2022
OUR GIFT TO YOU
15% OFF your first order
Use a coupon FIRST15 and enjoy expert help with any task at the most affordable price.
Claim my 15% OFF Order in Chat

Good News ! We now help with PROCTORED EXAM. Chat with a support agent for more information