我有这段代码:
my_dict = {'key1':'roger','key2':'bootsma'}
print (my_dict['key1']), (my_dict['key2'])
但是我似乎无法像人们怀疑的那样在一行上打印。它确实打印了一个键,但在同一行之后无法打印键。
答案 0 :(得分:0)
您问题的普遍接受的答案是:
print('%s %s' % (my_dict['key1'], my_dict['key2']))
# or
print(' '.join(my_dict.values()))
# or
print(my_dict['key1'], end='')
print(my_dict['key2'])
其他一些可能性:
select
sum(
(CASE WHEN (isnumeric(TotalTime) = 1)
THEN CAST(TotalTime AS bigint)
ELSE 0
END)
) as 'TotalTime',
sum(TotalCount) as 'TotalCount',
AVG(
(CASE WHEN (isnumeric(MinTime) = 1)
THEN CAST(MinTime AS bigint)
ELSE 0
END)
) as 'MinAvgTime',
AVG(
(CASE WHEN (isnumeric(MaxTime) = 1)
THEN CAST(MaxTime AS bigint)
ELSE 0
END)
) as 'MaxAvgTime',
dateadd(DAY,0, datediff(day,0, InputDate)) as created
from MYTABLE
group by dateadd(DAY,0, datediff(day,0, InputDate))