Beginner's Problems based on Modules and String Manipulation.
Create a program which produces a random integer from 1 to 100 (inclusive).
Let the user guess the random number. If the user has an incorrect guess, provide the appropriate output (e.g. if the guess is too high, output ‘Your guess was too high.’) Keep letting the user guess until they input the correct number.
Output the number of tries the user had in order to guess the number.
Given the starting stop and the ending stop, calculate the fare needed to travel.
The fare is calculated with this formula:
Base fare + (fare per stop * number of stops travelled)
The base fare is $5.00 and the fare per stop is $2.50.
Example: Input is in bold
What number stop are you at? 3
What is the stop you want to go to? 4
The fare from Stop 3 to Stop 4 is $7.50
Given a password input, check against the following criteria to determine if the password is strong, moderately strong or weak (and output to the user).
The criteria for a strong password is:
- Is it longer than 7 characters?
- Does it have an uppercase letter?
- Does it have a lowercase letter?
- Does it have a number?
- Does it have a special character/symbol (i.e. non alpha-numeric character)
Each of these criteria contribute 1 point to the password’s ‘score’. If the score is 5 (i.e. all criteria is fulfilled) then the password is deemed ‘strong’. If the score is 3 or 4, the password is ‘moderately strong’ and if it’s 0,1, or 2, the password is ‘weak’.