~一緒にプログラミングやろうぜ~第5回変数を使ってみる
記載者あばば
新聞奨学生の記事は こちらから
![](https://steemitimages.com/640x0/https://cdn.steemitimages.com/DQmVWFGmovGq7S9mL3iMqxhUmQcDJLKf98QXx6xTMaGnups/%E3%81%8F%E3%81%BE.jpg)
1か月近く空いてしまったけど
今日もpythonをちまちま学んでいこうとおもう。
さて今回は変数について学んでいこうかなと思います。
そもそも変数ってなんだろう。
→数字や文字を記憶することのできるもの!実は前回のグラフを書くときにも、xとかyっていう変数を作って格納してありました!。
![](https://steemitimages.com/640x0/https://cdn.steemitimages.com/DQmVWFGmovGq7S9mL3iMqxhUmQcDJLKf98QXx6xTMaGnups/%E3%81%8F%E3%81%BE.jpg)
![](https://steemitimages.com/640x0/https://cdn.steemitimages.com/DQmTqYZsE3YhGPcD33N87PAh8W3KoeJHSGwniv9xGzscGR5/sorce.jpg)
今回は変数に慣れようということで標準入力!に挑戦してみようと思う。
![](https://steemitimages.com/640x0/https://cdn.steemitimages.com/DQmVWFGmovGq7S9mL3iMqxhUmQcDJLKf98QXx6xTMaGnups/%E3%81%8F%E3%81%BE.jpg)
入力した文字を変数にいれてその変数を表示するプログラムを作成する。
結果
![](https://steemitimages.com/640x0/https://cdn.steemitimages.com/DQmVWFGmovGq7S9mL3iMqxhUmQcDJLKf98QXx6xTMaGnups/%E3%81%8F%E3%81%BE.jpg)
できた!
![](https://steemitimages.com/640x0/https://cdn.steemitimages.com/DQmVWFGmovGq7S9mL3iMqxhUmQcDJLKf98QXx6xTMaGnups/%E3%81%8F%E3%81%BE.jpg)
では入力が複数だった場合どうなるだろうか。
配列とかリストとか!そういう呼び方をする変数を一杯もってるものに入れれるのです。
んで1番目に変数xいれるー 2番目に変数yいれるー
とかできるんですね。
やってみよう。
![](https://steemitimages.com/640x0/https://cdn.steemitimages.com/DQmVWFGmovGq7S9mL3iMqxhUmQcDJLKf98QXx6xTMaGnups/%E3%81%8F%E3%81%BE.jpg)
できた!
次回はFor文
Thank you for your post. :) I have voted for you: 🎁! To call me just write @contentvoter in a comment.
thank you
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!
![](https://steemitimages.com/640x0/https://codingforspeed.com/images/i-love-coding.jpg)
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) :
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