当前位置:网站首页>2021-03-16 comp9021 class 9 notes

2021-03-16 comp9021 class 9 notes

2022-06-24 08:23:00 Purple cloud without dike

slice function

Official documents :slice(start, stop[, step])
The first number is the starting point , The second number is the end point , The third number is the step size

  1. from 1 To 6, Take a point every two times
     Insert picture description here
  2. The sliding window , And sum up - sliding window
     Insert picture description here
  3. Find the largest sum and output
     Insert picture description here

python Bring their own debug function

Official information :debugger
Other introductions :breakpoint() function

p: Output information

p a: Output a Value
 Insert picture description here

help : View help documents

h Is shorthand.

View the help document for a command
see p, exit Documents
 Insert picture description here

c: Continue to the next breakpoint

continue
 Insert picture description here

b: Add Breakpoint

b: View the breakpoints currently added with the command
b n: In the n Line add breakpoint
 Insert picture description here

b n, exp: Satisfy exp when , In the n Line add breakpoint
 Insert picture description here

practice : In the 7 Line add breakpoint , Carry on , see i Value .
 Insert picture description here

n: Execution continues until the next line or end of the current function .

stay for Use in circulation n
 Insert picture description here

!: Statement

!a = 4: Direct to variable a The assignment is 4
 Insert picture description here

step: Stepping , Execute the next statement , Or enter the called function .

Abbreviation :s

return: Carry on , Until the current function returns .

Abbreviation :r

tbreak: Temporary breakpoint , Automatically delete after one execution .

原网站

版权声明
本文为[Purple cloud without dike]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/175/202206240442428883.html