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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T08:21:11+00:00 2026-06-18T08:21:11+00:00

I need to get 10 numbers from the user, and than calc the amount

  • 0

I need to get 10 numbers from the user, and than calc the amount of times each digit is appear in all the numbers.

I wrote the next code:

# Reset variable
aUserNum=[]
aDigits=[]

# Ask the user for 10 numbers
for i in range(0,2,1):
    iNum = int(input("Please enter your number: "))
    aUserNum.append(iNum)

# Reset aDigits array
for i in range(0,10,1):
    aDigits.append(0)

# Calc the count of each digit
for i in range(0,2,1):
    iNum=aUserNum[i]
    print("a[i] ",aUserNum[i])
    while (iNum!=0):
        iLastNum=iNum%10
        temp=aDigits[iLastNum]+1
        aDigits.insert(iLastNum,temp)
        iNum=iNum//10

print(aDigits)

from the result, I can see that the temp is not working.
When I write this temp=aDigits[iLastNum]+1, Shouldn’t it say that the array in cell iLastNum will get the value of the cell +1?

thanks,
Yaniv

  • 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-18T08:21:13+00:00Added an answer on June 18, 2026 at 8:21 am

    You can concatenate all the inputs to get a single string and use this with collections.Counter()

    import collections
    ct = collections.Counter("1234567890123475431234")
    ct['3'] == 4
    ct.most_common() # gives a list of tuples, ordered by times of occurrence
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Title pretty much describes it, I just need to get all the order numbers
I am trying to get input from the user and need to know a
I'll need to accept a string of 5 numbers from the user (only 5).
AssemblyName.GetAssemblyName().Version.ToString() will give the version number ,,but i need to get version number from
I need to get the square root of a 210 digit number accurately, I
I need to ask an input from a user and he/she should have the
Getting the information from the HTTP User-Agent header using navigator.userAgent in JavaScript we get
I am getting user details from .net web server. I place all these in
I need to get shipping rates from USPS. I have signed up with them,
I am trying to get all the followersIDs from an a twitter account with

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.