addClass(id, capacity, time):
removeClass
infoClass
addStudent
removeStudent
infoStudent
enrollStudent
unenrollStudent
addClass(id, capacity, time):
removeClass
infoClass
addStudent
removeStudent
infoStudent
enrollStudent
unenrollStudent
问:
import copy newobj = copy.copy(oldobj) # shallow copy newobj = copy.deepcopy(oldobj) # deep (recursive) copy
Implement a recursive function evalPolish(
Here is a sample expression and its evaluation:
>>> good = ("+", ("-", 3, 1), ("*", ("/", 3, 4), 7)) # Same as
// ~ Overview ~ //
This exercise will familiarize you with structures, dynamic memory allocation, and
file operations.
// ~ Learning Goals ~ //
(1) To learn to read and write a structure into a file
(2) To learn to manipulate arrays
// ~ Submitting Your Assignment ~ //
You must submit one zip file to blackboard. This zip file must
contain:
(1) pe07.c
(2) bmp.c
You create the zip file using the following command.
> zip pe07.zip pe07.c bmp.c
// ~ Overview ~ //
The main purpose of this exercise is to familiarize you with
structures. It will also give you more practice with file operations
and memory allocation.
This exercise (and the next one) will gear you up for PA04, which
deals with an image format called BMP, which is commonly used in the Windows
operating system. Most web browsers are also able to read and display BMP files.
It is a modification of the exercise that Prof. Yung-Hsiang Lu gave to
his class.
In this exercise, you will read in a BMP file, and depending on the option
given, outpu
1.What is the value of the following expression:
sеt (rаngе (0, 20, 3)) & sеt (rangе (0, 20, 2))
{0, 6, 12, 18}
{0, 2, 3, 4, 6, 8, 9, 10, 12, 14, 15, 16, 18}
{3, 9, 15}
{2, 3, 4, 8, 9, 10, 14, 15, 16}
. 2.
Which operators are applicable to sets? (Check all that apply.)
+
–
*
&
|
^
/
in
. 3.
Which expression correctly changes the tail (the last element) of the middle item in the following
tuple:
foo=(12, [“a”, “n”, “d”, “y”], set (“andy”))
foo[1][-1] = “a”
foo[0][0] = “a”
Tuples are immutable and cannot be changed.
The tuple foo has items of different data types and is illegal.
. 4.
Which data type cannot be used as a key in a dictionary?
list
int
float
string
. 5.
Which data structures could be used instead of the following dictionary without any loss of
information and functionality, including possible modifications both of element names and their
weights?
elements = {“H” : 1, “He” : 4, “Li” : 7, “Be” : 9}
names = [“H”, “He”, “Li”, “Be”]
weights =
作业要求:
http://www.sussex.ac.uk/Users/mfb21/net/ex2/index.html
You can use this code to check if your code compiles properly by compiling it t
python csv assignment
|