Python Forum
Print the Largest Odd Number
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Print the Largest Odd Number
#5
Your while condition is false to start with, because Count starts at 0. (note that count and Count are two different variables, pick one and use it consistently). You want to loop while Count < 10, so the loop stops after 10 questions. Note that line 9 is backwards. You want to assign p to MaxValue, not MaxValue to p.

As it is now, your code goes until it gets 10 odd numbers, ignoring even numbers. That wasn't quite how you stated the problem initially. If that is what the problem requires, all is well. Otherwise, move line 9 down one line, and unindent it once.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Messages In This Thread
Print the Largest Odd Number - by Than999 - Jul-17-2019, 02:49 PM
RE: Print the Largest Odd Number - by ichabod801 - Jul-17-2019, 03:05 PM
RE: Print the Largest Odd Number - by DeaD_EyE - Jul-17-2019, 04:08 PM
RE: Print the Largest Odd Number - by Than999 - Jul-24-2019, 01:52 AM
RE: Print the Largest Odd Number - by ichabod801 - Jul-24-2019, 02:19 AM
RE: Print the Largest Odd Number - by jefsummers - Jul-24-2019, 11:35 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Linked List - Ordering by largest population with country name. PaleHorse 2 2,952 Jun-16-2020, 09:04 PM
Last Post: jefsummers
  How can I print the number of unique elements in a list? AnOddGirl 5 3,306 Mar-24-2020, 05:47 AM
Last Post: AnOddGirl
  How to print a statement if a user's calculated number is between two floats Bruizeh 2 2,411 Feb-10-2019, 12:21 PM
Last Post: DeaD_EyE
  Print only number penoxcz 1 2,581 Nov-10-2017, 11:04 AM
Last Post: metulburr
  Program to print: Last Name, ID, Mobile Number, All panick1992 14 9,841 Mar-15-2017, 02:46 PM
Last Post: panick1992

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020