![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
NOTEBOOK
M_osaic
这个作者很懒,什么都没留下…
展开
-
python|Varible Basic Content
Linefeed Punctuation原创 2021-12-20 11:33:16 · 289 阅读 · 0 评论 -
python|List: Common Operation
Sumlist_a = [1, 2, 2, 3, 4, 5, 6]print(sum(list_a))#23Countlist_a = [1, 2, 2, 3, 4]print(list_a.count(2))#2原创 2021-12-20 08:02:07 · 342 阅读 · 0 评论 -
python|List and sublist
list_a = [1, 2, 3, 4]#1 2 3 4 list_b = list_a[2:]#4原创 2021-12-20 07:49:51 · 857 阅读 · 0 评论 -
python|Punctuation
目录 Escape Escape#Asking for 5'17"a = "5'17\""#5'17"#\" or \' : Escape原创 2021-12-20 07:47:22 · 390 阅读 · 0 评论 -
python|Linefeed
a = """Banana"""#Bananab = """Banana"""#Ban#ana原创 2021-12-20 07:06:50 · 455 阅读 · 0 评论 -
python|input 格式
a = int(input()*3)print(a)#1#111b = int(input("")*3)print(b)#2#222c = int(input())*3print(c)#3#9原创 2021-11-08 03:59:33 · 487 阅读 · 0 评论 -
python|f-string and quotation mark
Python 3's f-Strings: An Improved String Formatting Syntax (Guide) – Real PythonThe quotation mark shouldn't be the same.x=int(input())print(f'W{x*"o"}w')#it doesn't work if the quotation mark is the same>>> f'I am {"Huang Wei"}''I am原创 2021-10-04 02:53:55 · 144 阅读 · 0 评论 -
python|how to input two or more INTs in the same line?
source:SPOJ.com - Problem SMPSUM#SMPSUM-Iterated sums#2021-10-03'''a = int(input())b = int(input())these two can't input in the same line'''a,b = map(int,input().split())c = 0for _ in range (a,b+1): c += _*_print(c)1. end='' can't use...原创 2021-10-04 02:29:20 · 94 阅读 · 0 评论 -
python|superposition problem in while loop(superposition problem2)
Original problem: ccc20j2People who study epidemiology use models to analyze the spread of disease. In this problem, we use a simple model. When a person has a disease, they infect exactlyRRother people but only on the very next day. No person is infec..原创 2021-09-04 04:36:07 · 186 阅读 · 0 评论 -
python|竞价者高问题
original problem: ccc21j2A charity is having a silent auction where people place bids on a prize without knowing anyone else's bid. Each bid includes a person's name and the amount of their bid. After the silent auction is over, the winner is the person原创 2021-09-04 03:55:52 · 166 阅读 · 0 评论 -
python|superposition problem in for loop
Original problem: ccc17j2the shifty sum whenNis12andk is1, itis:12+120=132. As another example, the shifty sum whenNis12andkis3is12+120+1200+12000=13332.#ccc17j2 shifty sum#E Sun#2021.09.03N=int(input())K=int(input())for i in ra...原创 2021-09-04 03:02:45 · 121 阅读 · 0 评论 -
python|if statement
Resource: ccc18j2 occupy parkingQuestion: Can if statement has 3 '=='?Answer: Yes.N=int(input())day1=input()day2=input()count=0for i in range(0,N,1): if day1[i]==day2[i]=="c": count+=1print(count)If statement has no limitation in原创 2021-09-04 01:45:59 · 128 阅读 · 0 评论 -
python|list-slice
原题:CCC'19J2-TimetoDecompressinput: 49 +3 -12 A2 Xoutput:+++++++++---AAAAAAAAAAAAXX#answerL=int(input())for _ in range(L): vals=input().split() N=int(vals[0])#why this works? ch=vals[1] print(ch*N)question: 我...原创 2021-09-04 00:06:41 · 189 阅读 · 0 评论