Coder Social home page Coder Social logo

donavinhannon / practice-python Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 1.0 453 KB

A collection of practice exercises I have completed from www.practicepython.org and the MIT 6.00.1X Computer Science course.

License: GNU General Public License v3.0

Python 100.00%
practice-python mit-6-00-1x

practice-python's Introduction

practice-python

A collection of practice exercises I have completed from MIT 6.00.1X and www.practicepython.org

MIT 6.00.1X

The rules of the game are as follows:

Dealing

  • A player is dealt a hand of n letters chosen at random (assume n=7 for now).

  • The player arranges the hand into as many words as they want out of the letters, using each letter at most once.

  • Some letters may remain unused (these won't be scored).

Scoring

  • The score for the hand is the sum of the scores for each word formed.

  • The score for a word is the sum of the points for letters in the word, multiplied by the length of the word, plus 50 points if all n letters are used on the first word created.

  • Letters are scored as in Scrabble; A is worth 1, B is worth 3, C is worth 3, D is worth 2, E is worth 1, and so on. We have defined the dictionary SCRABBLE_LETTER_VALUES that maps each lowercase letter to its Scrabble letter value.

  • For example, 'weed' would be worth 32 points ((4+1+1+2) for the four letters, then multiply by len('weed') to get (4+1+1+2)*4 = 32). Be sure to check that the hand actually has 1 'w', 2 'e's, and 1 'd' before scoring the word!

  • As another example, if n=7 and you make the word 'waybill' on the first try, it would be worth 155 points (the base score for 'waybill' is (4+1+4+3+1+1+1)*7=105, plus an additional 50 point bonus for using all n letters).

Practice-Python.org

Rules

  • A 4-digit number is randomly generated, try to guess it.
  • For every digit you guessed correctly in the correct place, you have a “cow”.
  • For every digit you guessed correctly in the wrong place you have a “bull”.
  • Every time you make a guess you will be told how many “cows” and “bulls” you have.
  • Once the user guesses the correct number, the game is over.
  • The number of guessed you took will be printed at the end.

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.