chap02/sample4.py
1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3
4# キーボード入力を読み込む
5s = input('Input something: ')
6print('Your input is : ', s)
7
8# 整数に変換
9a = int(input('Input integer 1: '))
10b = int(input('Input integer 2: '))
11print('Sum of two integers : ', a + b)
12
13# 実数に変換
14c = float(input('Input real: '))
15print('Square of float : ', c*c)