Home > other >  Beginners do a note, don't laugh
Beginners do a note, don't laugh

Time:09-17

while loop
 
Def Even (e) :
'even functions'
A=2
B=0
While a & lt;=e:
B +=1/a
If a & gt; E:
Break
A +=2
Return b


Def Odd (o) :
'definition odd function'
C=1
D=0
While c & lt;=o:
D +=1/c
If c & gt; O:
Break
C +=2
Return d

H=int (input (' please enter an integer: '))
If H % 2==0:
H=Even (H)
The else:
H=Odd (H)
Print (H)



for loop

 
Def Even (e) :
'even functions'
B=0
For a in range (2, e + 1, 2) :
B +=1/a
Return b

Def Odd (o) :
'definition odd function'
D=0
For c in range (1, o + 1, 2) :
D +=1/c
Return d

H=int (input (' please enter an integer: '))
If H % 2==0:
H=Even (H)
The else:
H=Odd (H)
Print (H)

CodePudding user response:

aaaaaaa

CodePudding user response:

CodePudding user response:

Can write their own CSDN blog, for example, I

CodePudding user response:

Code format is correct, clear rules, some comments by
  • Related