Home > other >  In Python the odd and out-of-order
In Python the odd and out-of-order

Time:11-03

CodePudding user response:

 
L=list (map (int, input (). The split (' ')))

If not l [1] <=0:
Print (' Error input! ')
The else:
Total=0
For n in l:
If n & gt; 0 and n % 2:
Total +=n
Print (' Total: 'Total)

CodePudding user response:

 
Numbers=[int (x) for x input in (). The split (" ")]
Min_value=https://bbs.csdn.net/topics/min (Numbers)
Cal_list=Numbers [:] if min_value & gt; 0 the else Numbers [: Numbers. The index (min_value)]
Print (sum (x, if x % 2==1 else 0 for x in cal_list))

CodePudding user response:

Senior, I tried this program seems to be no

CodePudding user response:

The
reference 1/f, 7-eleven's reply:
 
L=list (map (int, input (). The split (' ')))

If not l [1] <=0:
Print (' Error input! ')
The else:
Total=0
For n in l:
If n & gt; 0 and n % 2:
Total +=n
Print (' Total: 'Total)

Senior, I tried this program seems to be no

CodePudding user response:

 

S='1 - two-thirds of + + 3/5-4/7 5/9'
The import re
Q=re. The.findall (' \ d/d \ ', s)
Q.i nsert (0, '1')
N=int (input (' please enter a positive integer: '))
New=q [: N]
Print (' %. 2 f % eval ('. Join (new)))