Python Forum
Finding largest value in a for loop
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Finding largest value in a for loop
#2
You need to help us in order for us to help you. That starts by properly posting your code. As it is, you have no indentation. When you say "...the code doesn't work", be specific. What doesn't work? If you get an output, what is the output. If you get an error, what is the error.

What is "list" supposed to do?
What is "for True:" supposed to do?
Where are you getting "SourceAddress" from?
Where are you getting "TOS" from?

Comparisons use a double equal sign, not a single one.
if value == another_value:
You declare largest as numeric and var as a string, than try to compare them, this will cause an error.
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
Reply


Messages In This Thread
Finding largest value in a for loop - by mingchew - Aug-16-2017, 11:28 AM
RE: Finding largest value in a for loop - by sparkz_alot - Aug-16-2017, 12:02 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
Question Help to find the largest int number in a file directory SalzmannNicholas 1 2,348 Jan-13-2022, 05:22 PM
Last Post: ndc85430
  find 2 largest equal numbers Frankduc 13 5,857 Jan-11-2022, 07:10 PM
Last Post: Frankduc
  Largest product in a grid (projecteuler problem11) tragical 1 2,861 Sep-14-2020, 01:03 PM
Last Post: Gribouillis
  Extract the largest value from a group without replacement (beginner) preliator 1 2,643 Aug-12-2020, 01:56 PM
Last Post: DPaul
  frequency of largest number group anshumanmuj 5 4,067 Jun-22-2020, 04:51 PM
Last Post: perfringo
  Sort by the largest number of the same results (frequency) inlovewiththedj 3 3,154 Apr-01-2020, 07:29 AM
Last Post: DPaul
  Find the second largest number DarkCraftPlayz 8 17,457 May-29-2019, 02:46 AM
Last Post: heiner55
  Need help for finding cumulative values in a loop Lightning1800 10 8,212 May-23-2018, 07:48 PM
Last Post: Lightning1800
  How to use python to do "for each 365 data, print the largest 18 value? ctliaf 1 3,486 Apr-28-2018, 08:14 PM
Last Post: snippsat
  Calculate the fewest zip codes, for the largest coverage nilamo 4 8,386 Mar-23-2017, 01:31 PM
Last Post: Bass

Forum Jump:

User Panel Messages

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