Python a,b = b,a在交换数组中的元素时给出错误的结果

时间:2018-12-18 23:35:39

标签: python swap

为什么第一个这样的交换错误?非常感谢。

#!/bin/bash

# caclulate the day after the 4th Thursday of the given year

export LC_TIME=C
month=11
year=$(date +%Y)    # assign to the year as "2018"
firstdayofweek=$(date -d "${year}-${month}-1" +%w)
# calculates the day of week of the 1st day between 0 and 6
# where 0=Sun, 1=Mon, ...

thu1=$(( (11 - $firstdayofweek) % 7 + 1 ))
# calculates the day of month of the 1st Thursday

thu4=$(( $thu1 + 21 ))
# the day of the 4th Thursday

dayAfterThanksGiving=$(( $thu4 + 1 ))
echo "$dayAfterThanksGiving"

0 个答案:

没有答案