-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathobjects_class.py
More file actions
74 lines (56 loc) · 1.42 KB
/
Copy pathobjects_class.py
File metadata and controls
74 lines (56 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/usr/bin/env python3
import random
'''class MyClass:
class_attribute = 5
var = MyClass()
print(var.class_attribute)
var.class_attribute = 10
var2 = MyClass()
print(var2.class_attribute)'''
'''class Employee:
def whatever(): #Method definition
pass
def __init__(self,last,first): #Special Method __init__
self.last = last
self.first = first
e0 = Employee('Yost', 'Nick')
print(e0.last,e0.first)'''
'''class Balloon:
def __init__(self,altitude,weight,is_inflated):
self.altitude = altitude
self.weight = weight
self.is_inflated = is_inflated
def __str__(self):
return 'A balloon cannot be printed you idiot'
def ascend(self):
self.altitude += howmuch
def descend(self):
self.descend -= howmuch
if self.altitude < 0:
self.altitude = 0'''
class Card:
def __init__(self, suit, value):
self.suit = suit
self.value = value
def __str__(self):
return '{} of {}'.format(self.value, self.suit)'
class Deck:
def __init__(self):
self.card = []
self.build()
def shuffle(self):
'''Randomly shuffles the deck
Args:
None
Returns:
None
'''
pass
def deal(self,cards=1):
'''Deals a number of cards
Args:
cards (int): the number of cards to remove from the deck
Returns:
List: list of cards dealt
'''
pass