小编use*_*694的帖子

Python的trigonmetric函数返回意外值

import math
print "python calculator"
print "calc or eval"
while 0 == 0:
    check = raw_input() #(experimental evaluation or traditional calculator)
    if check == "eval":
        a = raw_input("operator\n") #operator
        if a == "+":
            b = input("arg1\n") #inarg1
            c = input("arg2\n") #inarg2
            z = b + c
            print z
        elif a == "-":
            b = input("arg1\n") #inarg1
            c = input("arg2") #inarg2
            z = b - c
            print z
        elif a == "/":
            b = input("arg1\n") #inarg1
            c = input("arg2\n") #inarg2
            z …
Run Code Online (Sandbox Code Playgroud)

python math trigonometry

4
推荐指数
1
解决办法
5649
查看次数

我不知道这段代码有什么问题?

可能重复:
我是python的新手,我不知道这是否有效

import time
from sys import stdout
varthing = 1
while varthing == 1:
    time.sleep(1)
    checker = time.strftime("\r%b, %d %H:%M:%S", time.localtime())
    print checker,
    stdout.flush()
    if checker == "Dec, 25 00:00:00" :
        print "It's Christmas"
        raw_input("Enter anything to close\n")
        varthing = 0
Run Code Online (Sandbox Code Playgroud)

我没有看到任何错误.这是圣诞节时通知你的时钟.

python

-1
推荐指数
1
解决办法
90
查看次数

标签 统计

python ×2

math ×1

trigonometry ×1