forked from rainyear/python3-in-one-pic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Highlight.html
34 lines (32 loc) · 1003 Bytes
/
Highlight.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ACE in Action</title>
<link href="http://cdn.bootcss.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet">
<link href="http://cdn.bootcss.com/highlight.js/8.6/styles/github-gist.min.css" rel="stylesheet">
<script src="//cdn.bootcss.com/highlight.js/9.1.0/highlight.min.js"></script>
<script src="//cdn.bootcss.com/highlight.js/9.1.0/languages/python.min.js"></script>
</head>
<body>
<pre><code class="python">
class Animal:
"""This is an Animal"""
def __init__(self, can_fly = False):
self.can_fly = can_fly
def fly(self):
if self.can_fly:
print("I CAN fly!")
else:
print("I can not fly!")
class Dog(Animal):
"""This is a Dog"""
def bark(self):
print("Woof!")
d = Dog()
d.fly() # I can not fly!
d.bark() # Woof!
</code></pre>
<script>hljs.initHighlightingOnLoad();</script>
</body>
</html>