+ 1
Mid task "That's odd..." on Python
Good day everyone! Faced the problem with solving this task. Can't understand what should I use in this code in order to create "n" numbers of lines which depends from the number which is in the first input? For examle: 3. It means that program should create 3 lines after 1-st input. I've read about "Diego code" on the Internet but unsuccessfully. If you can give any useful information about it or maybe solving of this problem, I'll be grateful! đ
8 Answers
+ 1
You take n from the user then create a loop for i in range(n)
take input in the loop that will take inputs n times
+ 1
Try this:
count = 0
for i in range(int(input())):
num = int(input())
count += [num, 0][num % 2]
print(count)
+ 1
Thanks to all for help! Brainstorming gave me add information about it. Also understood how works bottom "Enter" on phoneđ Earlier didn't see itđ. Bhavya Sarraf your code really works, i'll learn it deeper in order to understand it in whole. My greatest thanks to you))
+ 1
Vasya Petrov no problem, IDK why it doesn't work for you, doesn't show any errors for me
0
Bagon your code don't work unfortunately but anyway thank you for spending your time on it.
0
Bagon you was right. Sry for my fail. It works correctly. Idk why it didn't work at the first time. Thank you for feedback