LoginSignup
0
0

More than 5 years have passed since last update.

『小中学生からはじめるプログラミングの本』のスクリプト

Last updated at Posted at 2017-09-18

『小中学生からはじめるプログラミングの本』 のメモ

インデント等,本に書かれているように書きます.
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 図10−2

def bmicheck(shintyou, taijuu):
    bmi=taijuu/((shintyou/100)**2)
    message="BMIは%.1fです。"
    if bmi>=25:
        message=message+"肥満です"
    print(message % bmi)

bmicheck(170,60)
bmicheck(170,80)
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0