Even odd Get link Facebook X Pinterest Email Other Apps l,h = map(int,input().split())k = int(input())lst=[]for i in range(l,h+1): lst.append(i)e =[]o=[]for i in lst: if i%2==0: e.append(i) else: o.append(i)el = len(e)ol = len(o)res = 0.5*((ol+el)*k + (el-ol)*k)print(int(res)) Comments Unknown15 August 2020 at 10:26There is problem in the first line pls correct itReplyDeleteRepliesUnknown15 August 2020 at 10:33write the corertn codeDeleteRepliesReplyReplyUnknown15 August 2020 at 10:29what mistake in first lineReplyDeleteRepliesReplyKishore15 August 2020 at 10:36answers are incorrectReplyDeleteRepliesReplyAdd commentLoad more... Post a Comment
There is problem in the first line pls correct it
ReplyDeletewrite the corertn code
Deletewhat mistake in first line
ReplyDeleteanswers are incorrect
ReplyDelete