~一緒にプログラミングやろうぜ~第5回変数を使ってみるsteemCreated with Sketch.

in #japanese6 years ago (edited)

job_programmer.png

記載者あばば

新聞奨学生の記事は こちらから




1か月近く空いてしまったけど
今日もpythonをちまちま学んでいこうとおもう。

さて今回は変数について学んでいこうかなと思います。

そもそも変数ってなんだろう。

→数字や文字を記憶することのできるもの!実は前回のグラフを書くときにも、xとかyっていう変数を作って格納してありました!。




今回は変数に慣れようということで標準入力!に挑戦してみようと思う。



入力した文字を変数にいれてその変数を表示するプログラムを作成する。

hyoujyun1.jpg

結果
result1.jpg



できた!



では入力が複数だった場合どうなるだろうか。

配列とかリストとか!そういう呼び方をする変数を一杯もってるものに入れれるのです。

んで1番目に変数xいれるー 2番目に変数yいれるー
とかできるんですね。

やってみよう。



hyoujyun2.jpg

result2.jpg
できた!

次回はFor文

Sort:  

Thank you for your post. :) I have voted for you: 🎁! To call me just write @contentvoter in a comment.

Hello! Your post has been resteemed and upvoted by @ilovecoding because we love coding! Keep up good work! Consider upvoting this comment to support the @ilovecoding and increase your future rewards! ^_^ Steem On!

Reply !stop to disable the comment. Thanks!

thanks . I Love Codeing too =)

Congratulations @abamogeteru! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :

Award for the number of upvotes

Click on the badge to view your Board of Honor.
If you no longer want to receive notifications, reply to this comment with the word STOP

Support SteemitBoard's project! Vote for its witness and get one more award!

Coin Marketplace

STEEM 0.28
TRX 0.13
JST 0.032
BTC 61369.52
ETH 2929.95
USDT 1.00
SBD 3.66