支那

Download:Vue2.0 to develop enterprise-class mobile music Web App

At present, there is not a Vue 2.0 advanced teaching in the market, all are some basic introductory courses, you can hardly find a complex application based on Vue. Js teaching, however, we prepared for you this unique Vue 2.0 advanced practical course. After completing this course, I will be able to independently take charge of a moderately complex project. If I can fully master all knowledge points of the course, I will be able to achieve baidu T4+ technical ability.

支那

支那

Suits the crowd

At least one year working experience in front end practitioner

支那

支那

Technical reserve requirements

1. Proficient in HTML, CSS and JavaScript programming

2. Have some basic knowledge of vue. js and practical development experience of vue. js

3. Experience with Node.js, NPM and Webpack

支那

1. Four digit alphanumeric textual code generation example

1 import random 2 if __name__ =="__main__": 1 import random 2 if __name__ =="__main__": 1 import random 2 if __name__ =="__main__": 5 index=random. Randrange (0,4) # generate a number from 0 to 3. =i and index +1 ! = I: 7 checkCode += CHR (random.randint(97,122)) # generate a lowercase letter in a~z 8 elif index +1== I: 9 checkcode += CHR (random.randint(65,90)) # generate A capital letter in A~Z 10 else: 11 print(checkcode) = STR (random. Randint (1,9))Copy the code

The output is m47A, 8wQ9, vugS

——————————-

2. Formatting time function

1 def formatTime(longtime): 3 import time 4 return time.strftime("%Y-%m-%d %H:% m :%S",time.localtime(longtime)Copy the code

——————————–

3. Record the display log instance

Import time def show_info(): print(" ") def write_loginfo(username): print(" ") def write_loginfo(username): Param username: username """ with open('log.txt','a') as f: String = "User name: {} Login time: {}\n".format(username ,time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(time.time()))) f.write(string) def Read_loginfo (): """ """ """ with open('log.txt','r') as f: while True: line = f.readline() if line == ": Print (line) # print a line if __name__ == "__main__": While len(username) < 2: Print (' username = 1 ') print(' username = 1 ') print(' username = 1 ') print(' username = 1 ') print(' username = 1 ') print(' username = 2 ') Print (' Password should be at least 6 characters long ') password = input(' Please enter password: Num = int(input(' ') print(' ') print(' ') write_loginfo(username) If num == 0: print(' num ') break elif num == 1: Print (' print ') read_loginfo() show_info() num = int(input(' print ') else: Print (' you input a wrong number ') show_info () num = int (input (' input operation number:)) -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 3. Imitate taobao customer service automatic replyCopy the code

3 def find_answer(question): 4 with open('reply.txt','r') as f: 5 while True: 6 line=f.readline() 7 if not line: # can also for the if the line = = 9 '8 break keyword = line. The split (' |') [0] 10. Reply = line split (' | ') [1] 11 if keyword in question: 15 if __name__ =='__main__': if __name__ =='__main__': 16 question=input(' please input what you want to ask: ') 19 break 20 reply=find_answer(question) 21 if not reply: 22 question=input(" I don't know what you are talking about, you can ask something about order, account and payment (to exit please enter bye) : ") 24 print(reply) 25 question=input(" You can ask something about order, account and payment (please enter bye to exit) : ") 27 ')Copy the code

4. Finding the Maximum Treaty Number and the Least Common Multiple (Division by Toss and Turn)Copy the code

Maximum treaty number: the largest common divisor of two or more integers

Least common multiple: The common multiple of two or more integers is called their common multiple, where the least common multiple other than 0 is called the least common multiple of the integers

Relation: Product of two numbers = least common multiple * maximum treaty number

1 a=int(input(' input ')) 2 b=int(input(' input ')) 3 s=a*b 4 while a%b! =0: 5 a,b=b,(a%b) 6 print(a) 7 print(b) 8 else: 10 print(s//b,'is the least common multiple ')Copy the code

More phase reduction method

1 a=int(input('please enter 1st num:')) 2 b=int(input('please enter 2nd num:')) 3 s=a*b 4 5 while a! =b: 6 if a>b: 7 a-=b 8 elif a<b: 9 b-=a 10 else: 11 print(a,'is the maximum common divisor') 12 print(s//a,'is the least common multiple' 1st num:40 16 please enter 2nd num:60 17 20 is the maximum common divisor 18 120 is the least common multipleCopy the code

5. Check whether it is a leap year (toss and turn division)Copy the code

Num =eval(input(" please enter a year: ")) 5 except: If (num %4==0 and num%100! =0) or num %400==0: 9 print(num," leap year ") 10 else: 11 print(num," leap year ")Copy the code

Import calendar year= int(input(" please enter year: ")) check_year=calendar.isleap(year) if check_year= = True: print (" leap year ") else: Print (" leap year ")Copy the code

6. Python counts the number of numbers, letters, and Chinese characters in a stringCopy the code

5 num_regex = re.compile(r'[0-9]'); 6 num_regex = re.compile(r'[0-9]') 6 Zimu_regex = re.compile(r'[u4E00-\u9FA5]') 7 Hanzi_regex = re.compile(r'[\u4E00-\u9FA5]') 9 Print (' Enter string :',str_test) 10 Num_list = num_regex.findall(str_test) 12 print(' Contains digits :',num_list) 13 zimu_list = Zimu_regix.findall (str_test) 14 print(' contains letters :',zimu_list) 15 hanzi_list = hanzi_regix.findall (str_test) 16 Print (' hanzi_list ')Copy the code

# Sheepdoor problem

1 import random as r 2 3 # 4 total=1000000 #1000,1W,10W,100W 5 # win1=0 7 win2=0 8 9 range(total): 11 man= r.rint (1,3) 12 car= r.rint (1,3) 13 #结果 : 16 win1+=1 17 else: 18 win2+=1 19 20 print(" {} ".format(total)) 21 print(" {:.3}%.". Format ((win1/total)*100)) 22 print(" Format ((win2/total)*100))Copy the code

1 import random 2 x=random. Randint (5000000,10000) 3 print(x) 4 change=0 5 nochange=0 6 for I in range(1,x+1): 7 a=random.randrange(1,4) 8 b=random.randrange(1,4) 9 if a==b: 10 nochange=nochange+1 11 else: Format (nochange/x) print(nochange/x) print(nochange/x) print(nochange/x)Copy the code