Python Forum
Print the Largest Odd Number
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Print the Largest Odd Number
#4
Hi Ichabod801,

thank you for your reply and your suggestion. However, I tried the what you suggested and it still doesn't work. Here is my code:

Count = 0
MaxValue = -99999999
while(Count != 0):
    p = int(input('Enter a odd number: '))
    if (p % 2 == 0):
        int(input('this is an even number, please enter another number'))
    elif (p % 2 != 0):
        count = count +1
        p = MaxValue
print('this is the largest odd number')
What is still wrong with my code? Any help or suggestions will be much appreciated. thanks!

-Tim
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,840 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