Alright i need help computing random dates and i have to use lists.

this is what the program should do

program must print out the following output:
1. The complete list of birthdays that you generated.
2. The birthday that was generated twice (printed separately from the list).
3. The count of birthdays the occurred in each month.

I wasnt sure how i could do this using list, ive learned lists,if statements,while loops randrange and some other stuff i cant really think how to do all of this thanks

Recommended Answers

All 4 Replies

Did you learn how to write a function ? Then start writing a function to generate a single random birthday

import random

def generate_birthday():
   # PUT YOUR EFFORTS HERE ?????
   return birthday

print(generate_birthday())

The datetime module could be a great help.

random.randint would be very helpful for you

What form do you want the birthdays in?
Most like strings of form
mm/dd/yyyy

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.