0

Why is my code wrong, someone should please explain in datails to me

Write a program that asks the user to input 10 integers, then print the largest odd number, if no odd number was entered, print a message to that effect. var=0 X= int(input( "input 10 random integers : ")) while (X %2!=0): var+=1 for i in range(x): print (i)

21st Jul 2020, 8:15 AM
Adeola Adetilewa
Adeola Adetilewa - avatar
4 Answers
+ 4
𝐊𝐢𝐢𝐛𝐨 𝐆𝐡𝐚𝐲𝐚𝐥 , in your first code: ... ("No Found") if a==[] else print(max(a)) will not print the message "No Found", when there is no odd value in the list 'a'. ("No Found") as it is in the code, creates a string, but does not save it. So to print this output ("No Found"), use: print("No Found") ...
21st Jul 2020, 10:37 AM
Lothar
Lothar - avatar
0
Am new to programming, i just started python some few days ago, can you explain in a why i can understand please...
21st Jul 2020, 8:34 AM
Adeola Adetilewa
Adeola Adetilewa - avatar