Skip to content

samnar2017/python-excercices

Repository files navigation

A Collection of Python Projects

A series of programs written in Python to perform various tasks.

Motivation

To learn and practice Python

Synopsis:

Dog Age:

This program asks the user for their dogs age and then prints the results in dogs years

Even or Odd:

This program asks the user for a number and then print the output telling the user if the number is even or odd.

Greeting program:

This program asks the user for various data about themself and prints output accordingly.

This program also does the following:

* Asks the user what their name is
* The output will be “Nice to meet you” and add the person’s name
* Asks the user what their favorite color is
* The output will be said color followed by “That’s a nice color” (Ex: Blue? That’s a nice color)
* Asks the user their favorite food
* The output will be said food followed by “sounds yummy” (Ex. Pizza sounds yummy)
* Asks the user if they have to go and if they say “no” loop the program again*

Prime Number:

This program displays all the prime numbers from 2 – 100.

Also, it states that it’s a prime number next to the number. (Ex: 2 is a Prime number) NOTE: A prime number is a whole number greater than 1, who is only divisible by 1 and itself.

User Input:

Given a set of numbers, this program returns the largest and smallest number in the set.

This program also does the following:

* Accepts X amount of numbers from a user
* Stores each value in a list
* Creates one or more functions which return the maximum number in the list.
* Creates one or  more functions which return the smallest number in the list.

Guessing Game:

This program is a game that does the following:

*Generates a random number from 1 to 10 (Look up the appropriate python class/function to do this)
* Asks the user to guess the number.
* Gives the user three guess to get the number correct.
* If the user guesses correctly, exits the game and congratulates the user.
* If the user fails gives the appropriate error message and exit the game.
* Modifies the program so that following requirements are met.
* If the user is within one of the correct answer displays “Hot”
* If the user is within two of the correct answer displays “Warm”
* All other guesses displays “Cold”

Quadratic:

This program solves for the value of a quadratic.

NOTE: A quadratic follows the format of AX2+BX + C (A,B,C are variables) You should test your for multiple combinations of positive and negative values of all variables.

This program also does the following:

* Asks the user to enter the value of A,B,C and X.
* Calculates the value of the quadratic.
* Outputs the quadratic along with the value of the quadratic. 

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages