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 8943135
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T11:41:56+00:00 2026-06-15T11:41:56+00:00

this is my code on python 3.2.3 IDLE: i’m basically having the user enter

  • 0

this is my code on python 3.2.3 IDLE:
i’m basically having the user enter a bunch of numbers and it is then converteded to a list. afterwards, i would like to check if there are any numbers less than 10 or over 100.

n = input("(Enter a empty string to quit) Enter a number: ")
while n != "":
    numbers.append(int(n))
    n = input("(Enter a empty string to quit) Enter a number; ")

print ("The list is", numbers)

if numbers < 10:
    print ("your list has numbers less than 10.")
if numbers > 100:
    print ("your list has numbers more than 100")

the list comes out alright but when i try to check if any values are less than 10 or over 100, it has an error. how can i fix this?

  • 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-06-15T11:41:58+00:00Added an answer on June 15, 2026 at 11:41 am

    Use any:

    if any(number < 10 for number in numbers):
        print ("your list has numbers less than 10.")
    if any(number > 100 for number in numbers):
        print ("your list has numbers more than 100")
    

    Also, there’s an all function in python too.

    And by the way, you can join both lines:

    if all(10 < number < 100 for number in numbers):
        #correct code goes here
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

this is my code on python 3.2.3 IDLE: numbers = [] numbers = input((Enter
I have this code in Python inputted = input(Enter in something: ) print(Input is
Consider this Python code for printing a list of comma separated values for element
Possible Duplicate: Python list append behavior Why does this code: x = [[]]*3 x[0].append('a')
I'm using python 3.2.3 IDLE and this is my code: originalList = [1, 2,
I was given this Python code that would calculate an MD5 value for any
Could you please help me converting this c++ code into python: I am trying
/Users/smcho/Desktop/bracket/[10,20] directory has abc.txt, but when I run this Python code import glob import
This code produces a different output in Python 2 and Python 3 . class
In Python I have this code: now = datetime.now().isoformat() if . not in now:

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.