Home > other >  Beginners Python, to solve
Beginners Python, to solve

Time:10-01

The fifth title, number of disposable input, separated by Spaces, don't know what to do,
Thank you thank you, best can give the code

CodePudding user response:

 def sum_odd () : 
Odd_sum=0
Str_num=input (" please input data: ")

# the input data segmentation
For num in str_num. Split (') :
# to judge whether end

If the eval (num) & gt; 0:
# filter has an even number and summation
If the eval (num) % 2==1:
Odd_sum +=int (num)
Print (" end of calculation, the data of the odd and as: \ n ", odd_sum)

CodePudding user response:

Thank you, I use the list comprehensions are also made
  • Related