Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a function that uses the random Links to an external site. module to generate random lottery ticket numbers. import random def build _ lotto

Write a function that uses the random
Links to an external site. module to generate random lottery ticket numbers.
import random
def build_lotto_ticket()-> str:
pass
A lottery ticket has:
5 numbers from 1 to 69(inclusive)
1 number from 1 to 26(inclusive, representing the "powerball")
hyphen-delimited numbers (e.g.1-2-3-4-5)
a powerball number starting with "PB"
Since the outputs are random, expect small differences each time this function runs. Results should look similar to the following:
>>> build_lotto_ticket()
'1-28-31-57-66-PB1'
>>> build_lotto_ticket()
'7-9-30-37-69-PB11'

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional Visual Basic 6 Databases

Authors: Charles Williams

1st Edition

1861002025, 978-1861002020

More Books

Students also viewed these Databases questions

Question

Technology. Refer to Case

Answered: 1 week ago