Python 作业辅导

Python程序辅导 辅导Python编程作业 Assignment

DNA Manipulation

DNA Manipulation

Computer science concepts can be applied to solve problems in many different domains. In this assignment, the problem domain is DNA manipulation. We have provided a page on DNA manipulation that covers the information — and defines the terms — that you will need. Bookmark that page: it will be a useful reference for this assignment.

To help guide your reading, you should make sure that you learn what the following terms mean as you read the DNA manipulation page. We have written the rest of the handout under the assumption that you know their definitions.

  • base
  • base pair
  • DNA
  • palindrome
  • DNA palindrome
  • restriction site
  • restriction enzyme
  • recognition sequence
  • DNA mutation
  • 1-cutter

What To Do

In this assignment, you will create

Video Poker Game

Vegas

Goals

The goal of this assignment is simple: write a video poker game. The game will follow the jacks or better rules listed at Wikipedia.

Specifics

Playing Video Poker

Video poker works a lot like real poker, though there are a few differences. A game follows these steps:

  1. Before any cards are dealt, the player selects the number of credits she wants to wager on the hand (between 1 and 5). These credits are deducted from the player’s balance before the hand is dealt. If the player wagers more than she has, put up a status message and ask again.
  2. The hand is dealt and displayed.
  3. The player selects zero or more cards to keep. Cards are selected by clicking on them; the word HELDappears over cards that will be kep

Python Lab

(Matrices and File I/O) Write a Python script named cluster_counter.py that takes command line arguments. The first argument will be a filename. The file loaded will contain an n by m matrix of different characters. This n by m matrix denotes different clusters where each same character represents a group. Casing is not important (i.e A and a are the same group). Touching characters (meaning adjacent and diagonal) of the same group are assumed to be in the same cluster. Write a program that tells the user how many groups exist and for each group, how many sub clusters exist.  (20 points)
Example file test.m
A B A A A
A B A A A
B B A A A
python cluster_counter.py test.m
You have 2 groups: A, B
The Number of clusters are listed below
A : 2
B : 1

Assignment 3 COMP9021, Session 2, 2015

Assignment 3
COMP9021, Session 2, 2015
Aims: The purpose of the assignment is to:
 process command-line arguments in the style of Unix utilities;
 become familiar with trees;
 possibly implement recursive solutions;
 develop problem solving skills.
Command line arguments
Both programs will read command line arguments. To read those we import the sys module and
process sys.argv, a list of strings whose rst element is the name of the module being interpreted,
whose second element is the rst command line argument, whose third element is the second command
line argument, etc. So if no command line argument is provided, then sys.argv is a list of length 1.
Submission
Your programs will be stored in les named display_tree.py and roman_arabic.py. Upload yours
le using WebCMS. Assignments can be submitted more than once: the last version is marked. Your
assignment is due by November 1 11:59pm.
Assessment
For each test, the automarking script will let your program run for 30 seconds.
For each of the two program

Logic Plan

Introduction

In this project, your Pacman agent will logically plan his way to the goal. You will write software that generates the logical sentences describing moving, eating, and (predictable) ghosts. You will encode initial states and goals and use logical inference to find action sequences that are consistent with these.

This diagram outlines the different steps of the propositional logic planning process.

 

As in Projects 0 and 1, this project includes an autograder for you to grade your answers on your machine. This can be run with the command:

python autograder.py

See the autograder tutorial in Project 0 for more information about using the autograder.

The code for this project consists of several Python files, some of which you will need to read and understand in order to complete the assignment, and some of which you can ignore.

Files you’ll edit:
logicPlan.py Wh

Grocery Store Simulation

Assignment 1 – Grocery Store Simulation

Marking scheme posted!

Sample tests posted! (See the unit test file for details.)

Grocery stores often have a difficult task: they must determine how many employees to hire to staff checkout lines during varying levels of customers throughout the day. Too few open lines means customers spend time angrily waiting; too many, and the store loses money paying its employees. It’s also important to get the right mix of regular and express checkout lines, and perhaps even self-serve lines. Which combination is best depends on what kind of customers the store has.

In this assignment, you’ll build an event-driven simulation for a grocery store, which will model customers using different types of checkout

GMU cs112 solution

Programming Project 6

This semester you will be writing a program that models elements of recognizing and creating characters. Optical character recognition is an important area of research that allows photographs or printed documents to be digitized; by doing so, these documents are made available for machine-based searching. On the flip side, http://en.wikipedia.org/wiki/CAPTCHAis a system for differentiating between humans and computers: the goal here is to generate a non-machine readable image that a human could identify. CAPTCHA helps reduce the amount of spam on the Internet.

We will implement a highly limited type of image matching, processing, and creation this semester. Rather than write this project at once, we will break the project down into

game Battleship python implementation

4.1 Overview

Computer games are nearly as old as electronic computers themselves. The first tic-tac-toe game was programmed on an EDSAC vacuum-tube computer. Your job will be to expand the Battleship program started in earlier labs into a fully-playable game.

4.2 The game of Battleship

Wikipedia has a thorough description of the origins of the game of Battleship. For purposes of this assignment, follow the following rules.

1.The game is played between two players (one human and one computer for your program).

2.Each player has an identical set of ships. Each ship has a length, a name (e.g., “submarine”), and a symbol (a letter, e.g., “S”).

3.Each player has a grid, called the “battle board”,  which is mostly hidden from the other player. The grid is used for marking the locations of the pl

python Tkinter recursively tree

Implement a program that shall recursively draw a “tree” in a Tkinter Canvas.

The program shall consist of a non-resizable 500×500 px canvas in a non-resizable window and a menu bar. The menu bar shall have one pull-down menu named “Draw” with two items named “Repaint” and “Exit”.

The “Exit” menu item, when selected, shall gracefully terminate the program.

The “Repaint” menu item, when selected, shall clear the canvas and draw a recursive tree at random position growing “up” (in the direction 90°). The initial length of the stem shall be 128 px. The tree shall have the number of cascades selected uniformly at random between 3 and 7, inclusive.

One cascade of the tree of length L, growing from the position (X,Y) in the direction D, shall consist of (see the attached file):

  1. the stem represented as a black line segment of length L originating at (X,Y) and forming the angle D degrees with the horizonta axis, and
  2. two trees of length L*0.8, growing from the end of the stem in the directions