# Algorithm代做 | tkinter | 代写Python | assignment – Assignment

### Assignment

Algorithm代做 | tkinter | 代写Python | assignment – 这是一个Algorithm面向对象设计的practice, 考察python基本语法和Algorithm的理解, 涵盖了Algorithm/tkinter/Python等程序代做方面, 这是值得参考的assignment代写的题目，偏基础的python练习题目

#### Objectives:

• Learn how to use the advanced data structures (such as: list, tuple, string, and dictionary)
• Learn and practice how to use if-elif-else statements.
• Learn and practice how to use loops.
• Learn and practice how to use functions.
• Appreciate the importance of data validations.
• Provide appropriate documentation and good programming style.

####### random Generate pseudo-random numbers

### Functions for integers

###### random.randrange(start, stop[, step])
• Return a randomly selected element from range(start, stop, step).
###### actually build a range object.
• The positional argument pattern matches that of range(). Keyword
###### unexpected ways.
• Changed in version 3.2: randrange() is more sophisticated about
###### random.randint(a, b)
• Return a random integer N such that a <= N <= b.
• Alias for randrange(a, b+1).

### Syntax

###### Here is the simple syntax to create this widget

w = Button ( master, option = value, … )

#### Parameters

• master This represents the parent window.
• options Here is the list of most commonly used options for this

######## 4

######## 5

######## 6

######## 7

######## 8

######## 10

######## 11

######## 12

######## 14

######## 15

######## 17

######## 18

# !/usr/bin/python

from tkinter import *

from tkinter import messagebox

top = Tk() top.geometry(“100×100”) def helloCallBack(): msg = messagebox.showinfo( “Hello Python”, “Hello World”)

B = Button(top, text = “Hello”, command = helloCallBack) B.place(x = 50 ,y = 50 ) top.mainloop()

# !/usr/bin/python

from tkinter import * import random

from tkinter import messagebox

top = Tk() top.geometry(“100×100”)

def helloCallBack(): msg = messagebox.showinfo( “Hello Python”, “Hello World”)

v1 = random.randrange(1, 10,1)

s1 = str(v1) B = Button(top, text = s1, command = helloCallBack) B.place(x = 50,y = 50)

s2 = random.randrange(1, 10,1) B = Button(top, text = s2, command = helloCallBack) B.place(x = 100,y = 50)

top.mainloop()

### Python Programming

#### Description of the problem:

###### cards after the two cards have been generated for each game.

Rules for this game: Initial cash for this game is specified by player. Maximum bet for each game is \$ 200. Minimum bet for each game is \$ 5. Two cards are used per game. Player can place his or her bet amount for each game. The winning prize is based on how many matched cards have been found: If one matched cards have been found, then the prize is 2 x. If two matched cards have been found, then the prize is 4 x. If no matched card has been found, then the player loses his or her bet for this game-session.

Example of a menu could look like the following:

#### Items to be handed in:

• An Algorithm for this program.
• A printed copy of your program Python source code and a printout of at least one sample run.
• All pages must be stapled together. No loose pages are accepted. The disk (USB memory stick) that you hand-in should contain all the related files in a folder called ####assign 4 o where: #### is the last four digit of your student number.
``````Game of cards
**************************************
``````
1. Help (display rules for this game)
2. Enter the total amount of money you bring in the casino for gambling
3. Roll the cards and then place your bet here (Max. is \$50, Min. is \$ 1 )
4. Generate the random numbers for the three cards
• current cash on hand
• number of winnings
• total number of games played so far
6. Quit
##### Note:
• Deduct 5% for each missing feature.
• Deduct 5% for any incorrect file name or folder name.
• Deduct 5% for any loose pages.
• Penalty for late submission of assignments is 5% for the first day, and an additional 10% for each day thereafter.
``````Your  assignment will be graded according to the following scheme:
``````
###### User interface, ingenuity, and overall evaluation / 3
``````Total: / 10

``````