Coder Social home page Coder Social logo

hmthyl / short-python-exercises Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 17 KB

Quick and basic Python, along with a few short games

Python 100.00%
python beginners-python bulls-and-cows fizzbuzz prime-numbers password-generator rock-paper-scissors tip-calculator convert-temperatures

short-python-exercises's Introduction

Short-Python-Exercises

Quick and basic Python

These are Python exercises completed in class around July 2021 (except, admittedly, the Rock Paper and Scissors game and the temperature conversion program, which I updated more recently (September))

List of contents

  1. BullsAndCows

    • A traditional game where the computer selects a random 4 digit number (no repeats), and the player must try and guess this number. Guess a digit in the correct 'place' and that's a Bull. Guess a correct number, but in the wrong place, you've got yourself a cow. e.g. Com: 1234 | You: 1624 = 2 Bulls (1, 4), 1 Cow (2). Of course, in the real game, you're not told which numbers are cows and which are bulls ;)
  2. CaseCount

    • A program that counts the number of upper and lower case letters in a string the user has inputted
  3. ConvertTemperatures

    • Allows you to convert Celsius to Fahrenheit, and vice versa
  4. EveryDigitEven

    • Prints out every number within range 100-400 incl., where each digit of the number is even
  5. FizzBuzz

    • You know what FizzBuzz is
  6. GuessTheNumber

    • COM guesses a number between 1-9 randomly; player must guess the number within 5 tries
  7. IsItPrime

    • User inputs a number: computer tells user if it is in fact(!) a prime number. Writing this one kicked my ass hard at the time, I'm not sure why? Wild.
  8. MaxofThree

    • User inputs three separate numbers and Python picks out the biggest number!
  9. MeatCooker

    • User inputs the type of meat they wish to cook (from a choice of 4 meats), along with the meat's weight in kg. The program then tells you how long the meat should be cooked for!* (I just repeated the word "meat" so much, it doesn't mean anything anymore. Meat.)
  10. PasswordGenerator

    • Generate a random password as needed: set the number of letters, numbers and special characters you wish!
  11. RangeExercises

    • Exercises making use of Python's range() function; pretty basic!
  12. ReverseUserString

    • Takes a string from the user and reverses the word order of that string
  13. RockPaperScissors

    • You know what this is :-)
  14. TipCalculator

    • Calculate how much each person in your group should pay towards an evenly split bill; staff tip included.

--

*HMthyl cannot be held responsible for over or undercooked meats.

short-python-exercises's People

Contributors

hmthyl avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.