-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpage.py
67 lines (64 loc) · 1.29 KB
/
webpage.py
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
import sys
webpage3 = """<html>
<h1>
hello world!
</h1>
<h2>JavaScript That Produces HTML</h2>
<p>
This paragraph starts in HTML ...
<script type="text/javascript">
</script>
... and this paragraph finishes in HTML.
</p>
</html>
"""
webpage1 = """<html>
<h1>JavaScript That Produces HTML</h1>
<p>
This paragraph starts in HTML ...
<script type="text/javascript">
write("<b>This whole sentence should be bold, and the concepts in this problem touch on the
<a href='http://en.wikipedia.org/wiki/Document_Object_Model'>Document Object Model</a>,
which allows web browsers and scripts to <i>manipulate</i> webpages.</b>");
</script>
... and this paragraph finishes in HTML.
</p>
<hr> </hr> <!-- draw a horizontal bar -->
<p>
Now we will use JavaScript to display even numbers in <i>italics</i> and
odd numbers in <b>bold</b>. <br> </br>
<script type="text/javascript">
function tricky(i) {
if (i <= 0) {
return i;
};
return tricky(i - 1);
}
tricky(10);
</script>
</p>
</html>"""
webpage2 = """<html>
<h1>
Hi Udacity,
</h1>
<h2>
Thanks a lot!
</h2>
<p>
I enjoyed a lot working in this course.
I owe you guys for lifetime.
</p>
<script type="text/javascript">
var i = 10;
while(i > 2)
{
i = i - 1;
write("<p>thank you!</p>");
};
</script>
<p>
<big><b><i>Keep Rocking</i></b></big>
</p>
</html>
"""