"Programming book starting from elementary and junior high school students" memo
Write indents, etc. as written in the book. p.14
wa.html
<script>
a=1;
b=1;
while(a<10000){
a++;
b=b+a;
}
document.write(b);
</script>
p.15
you.html
<script
src="http://maps.google.com/maps/api/js">
</script>
<script>
navigator.geolocation.getCurrentPosition(
function(a){b=new
google.maps.LatLng(a.coords.latitude,
a.coords.longitude);new
google.maps.Marker({position:b, map:new
google.maps.Map(document.getElementById("c"),
{zoom: 17, center:b})});
});
</script>
<div id="c" style="width:100%; height: 100%">
</div>
p.129 Figure 10-2
def bmicheck(shintyou, taijuu):
bmi=taijuu/((shintyou/100)**2)
message="BMI%.It is 1f."
if bmi>=25:
message=message+"I'm obese"
print(message % bmi)
bmicheck(170,60)
bmicheck(170,80)
Recommended Posts