Generate Lotto Numbers Using a Method

Learn about method parameters and returning value through the lotto numbers problem.

We'll cover the following

Problem

Write a program to generate six lotto numbers. They must be between 1–49. Define a method that returns a valid lotto number, and make use of that method in your program.

Get hands-on with 1400+ tech skills courses.