import numpy as arithmetic
Pi=arithmetic.pi
range,Shaku,Make a letter,Print,integer,Crush= \
range, len, str, print, int, hash
true,false, 全てtrueなればtrue, いずれかtrueならばtrue,Maximum value,minimum value= \
True, False, all, any, max, min
Authenticity= {true:"true",false:"false", "Heliocentrism":"true", "Ptolemaic theory":"false"}
multiplication=lambda instep,B:Instep*B
Single number= ["Reiichi 2nd San 456,789"[Times] for Times in 範囲(10)]
#Function definition
def han(Formal argument):
Answer= ''
for character in character(Formal argument):
try:
Answer+=Single number[integer(Character)]
except ValueError:
Answer+=Character
return answer
def square(number):
return multiplication(number, number)
#Group definition
class shape:
#Method definition
def __init__(self,color= "black"):
myself= self
myself.color=color
def what color(myself):
return myself.color+ "color"
#Group inheritance
class yen(Shape):
#Method definition
def __init__(self,radius,color= "black"):
myself,Top= self, super
Initialize at higher level=Top().__init__
myself.radius=radius
Initialize at higher level(color)
def area(self):
myself= self
return multiplication(Pi,Square(myself.radius))
#Arithmetic book
for times in range(1,5):
Print('Current',Han(Times), end='')
Print()
Array= [true, true,false]
Print("The scale of the array is",Han(Shaku(Array)))
Print("Fake",Authenticity[True if all is true(Array)])
Print("The heliocentric theory",Authenticity["Heliocentrism"],"To know")
Print(Han([5,9,6,3]),"The maximum value of",Han(Maximum value([5,9,6,3])))
Print('Pi is',Chinese numeral(Pi))
Month=Circle(radius= 2,color= "yellow")
Print('The color of the moon',Month.what color())
Print('The radius of the moon',Han(Month.radius), 'If it is a scale, its area is',Han(Month.area()), "Shaku Sakuya")
Present Ichi Present 2 Present Participation Currently 4
The scale of the array is
False if false
The heliocentric theory can be understood as true
[Five,Nine,Six,three] の最大値はNine
Pi.Ichi 4 I 1 59 2 6 5 9 5 8 7 9 9
The color of the moon is yellow
If the radius of the moon is 2 shaku, the area is 1 2.566, 6th, 7th, 6th, 4th, 59th, 7th, 2nd shaku
Recommended Posts