Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6883273
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:21:41+00:00 2026-05-27T05:21:41+00:00

I am writing a program that calculates the minimum and maximum of 10 numbers

  • 0

I am writing a program that calculates the minimum and maximum of 10 numbers from a list (data1). I am receiving a “TypeError: ‘float’ object is not iterable” for the following lines:

temp_min10=min(data1[x-z][3])
temp_max10=max(data1[x-z][2])

Full program:

x=int(0)
for line in data1:
    if x>=9:
        min10=0
        max10=0
        for z in range(0,10):
            temp_min10 = temp_max10 = 0
            temp_min10=min(data1[x-z][3])
            if temp_min10<min10:
                min10=temp_min10
            temp_max10=max(data1[x-z][2])
            if temp_max10>max10:
                max10=temp_max10
            d_chan.append([max10,min10])
    else:
        d_chan.append([0,0])
        x+=1

Thanks for any help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T05:21:41+00:00Added an answer on May 27, 2026 at 5:21 am

    The possible args for min and max are either one iterable or 2 or more scalars. Docs here. You have given it one arg which is not an iterable; it’s a float.

    Aside: (1) Your indentation as displayed is patently incorrect. You need to (a) avoid tabs in your source file (b) ensure that your indentation is logically correct. (2) Your code is iterating for line in data1: but never mentions line again; looks like you need to check carefully what you are doing with x; it’s not obvious.

    Update after reading your code again:

    The following code will probably do what you want.

    # These assertions state the presumed effect of code that you have not included.
    assert len(data1) == 10
    assert d_chan == []
    # I suspect a typo in the OP ... it makes more sense for the 
    # two values below to be the same.
    MIN_COL = 3
    MAX_COL = 2
    d_chan = [[0, 0] for i in xrange(9)]
    min10 = min(data1[i][MIN_COL] for i in xrange(10))      
    max10 = max(data1[i][MAX_COL] for i in xrange(10))
    d_chan.append([max10, min10])
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing an assembly program that calculates Fibonacci numbers, but I need to find
I'm writing a program that calculates input a user gives, simple numbers. 2, 4,
I'm writing a program that calculates the Jacobi algorithm. It's written in Objective-C since
If you are writing a program that is executable from the command line, you
I built a little program that calculates the average of 15 numbers or less.
I am interested in writing a program that calculates the value of Pi to
I'm am currently writing a program that calculates the digits of pi, and I
I'm writing a program that asks the user for their birthdate and then calculates
Program calculates sum of numbers from 1 to N.. Child process calculates sum of
I am writing a program in C that calculates this formula: (source: crewtonramoneshouseofmath.com )

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.