Skip to content

RBJii/Python-for-Beginners

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

1. Dice Rolling Simulator

The Goal: Like the title suggests, this project involves writing a program that simulates rolling dice. 
When the program runs, it will randomly choose a number between 1 and 6. (Or whatever other integer you prefer — the number of sides on the die is up to you.) 
The program will print what that number is. It should then ask you if you’d like to roll again. 
For this project, you’ll need to set the min and max number that your dice can produce. 
For the average die, that means a minimum of 1 and a maximum of 6. 
You’ll also want a function that randomly grabs a number within that range and prints it.

Concepts to keep in mind:

Random
Integer
Print
While Loops

A good project for beginners, this project will help establish a solid foundation for basic concepts. 
And if you already have programming experience, chances are that the concepts used in this project aren’t completely foreign to you. 
Print, for example, is similar to Javascript’s console.log.


2. Guess the Number

The Goal: Similar to the first project, this project also uses the random module in Python. 
The program will first randomly generate a number unknown to the user. 
The user needs to guess what that number is. (In other words, the user needs to be able to input information.) 
If the user’s guess is wrong, the program should return some sort of indication as to how wrong (e.g. The number is too high or too low). 
If the user guesses correctly, a positive indication should appear. 
You’ll need functions to check if the user input is an actual number, 
to see the difference between the inputted number and the randomly generated numbers, and to then compare the numbers.

Concepts to keep in mind:

Random function
Variables
Integers
Input/Output
Print
While loops
If/Else statements


Jumping off the first project, this project continues to build up the base knowledge and introduces user-inputted data at its 
very simplest. With user input, we start to get into a little bit of variability.

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages