学习笔记
题很多做了一天还没做完。
-
马里奥
-
单边
# ## ### ####
-
两边
# # ## ## ### ### #### ####
-
核心代码:
print("#" * times,end="")
-
-
现金,美元转美分
-
结果
Change owed:0.47 5
-
核心代码
times = cent//10 coins += times cent -= times*10
-
-
信用卡,判断是哪种类型的卡。VISA,AMEX,MasterCard
-
结果
Number:456876543245562 INVALID Number:378282246310005 AMEX
-
核心代码
def is_valid(s): first_sum_number = 0 second_sum_number = 0 for i in range(len(s) - 2,0,2): first_sum_number += s[i]//10 + s[i%10] second_sum_number += first_sum_number for j in range(len(s) - 1,0,2): second_sum_number += s[j] if(second_sum_number % 10 == 0): return True else: return False
-