[ Web Proxy ]
URL:
Viewing: https://raw.githubusercontent.com/bunshue/vcs/master/_4.python/function/function2.py [Back]  [Original]

print(", ")


def area(radius):
    result = radius * radius * 3.14
    return result


def washingMachine():
    print("")
    print("")
    print("")
    print("")
    print("")


washingMachine()


def washingMachine(mode):
    print("")
    if mode == "soft":
        print("")
    elif mode == "hard":
        print("")
    else:
        print("")


mode = "soft"
if mode == "soft":
    print("")
elif mode == "hard":
    print("")
else:
    print("")


print(", ")


def mycnt1():
    for i in range(10, 20, 5):
        print(i)


mycnt1()

print(", ")


def mycnt2(n):
    for i in range(10, n, 5):
        print(i)


mycnt2(30)

print(", ")


def mycnt3(n=20):
    for i in range(10, n, 5):
        print(i)


mycnt3()
mycnt3(30)

print(", ")


def mycnt4(n1=10, n2=20):
    for i in range(n1, n2, 5):
        print(i)


mycnt4()
mycnt4(5)
mycnt4(5, 15)

print("")


def mysum(n1, n2):
    ""
    return n1 + n2


print(mysum(10, 20))


def f(x):
    return x**2


f(10)


def add(x, y):
    return x + y


z = add(1234, 5678)
print(z)


# 
def avg(first, *rest):
    return (first + sum(rest)) / (1 + len(rest))


a = avg(1, 2)
b = avg(1, 2, 3, 4)

print("average 1", a, "\n")
print("average 2", b, "\n")


def japanese(month):
    month_name = {
        1: "",
        2: "",
        3: "",
        4: "",
        5: "",
        6: "",
        7: "",
        8: "",
        9: "",
        10: "",
        11: "",
        12: "",
    }
    try:
        response = month_name[month]
    except:
        response = ""

    return response


print(japanese(5))


def add2number(a, b):
    global d
    c = a + b
    d = a + b
    print("(c={}, d={})".format(c, d))
    return c


c = 10
d = 99
print("(c={}, d={})".format(c, d))
print("{} + {} = {}".format(2, 2, add2number(2, 2)))
print("(c={}, d={})".format(c, d))


def add(n1, n2):
    return n1 + n2


def sub(n1, n2):
    return n1 - n2


print(add(5, 2))  # 7
print(sub(5, 2))  # 3


def ctof(c):  # 
    f = c * 1.8 + 32
    return f


inputc = float(input(""))
print("%5.1f " % ctof(inputc))

Web Proxy Viewer  |  New URL  |  Original Page