Skip to content
MPGHThe Dark Arts
/
RegisterLog in
Forum
Community
What's NewLatest posts across the boardTrendingHottest threads right nowSubscribedThreads you follow
Discussion
GeneralIntroductionsEntertainmentDebate FortFlaming & Rage
Board
News & AnnouncementsMPGH TimesSuggestions & HelpGiveaways
More Sections
Art & Graphic DesignProgrammingHackingCryptocurrency
Hacks & Cheats
Games
ValorantCS2 / CS:GOCall of Duty / WarzoneFortniteApex LegendsEscape From Tarkov
+14 moreLeague of LegendsGTA VMinecraftRustROTMGBattlefieldTroveBattleOnCombat ArmsCrossFireBlackshotRuneScapeDayZDead by Daylight
Resources
Game Hacking TutorialsReverse EngineeringGeneral Game HackingAnti-CheatConsole Game Hacking
Tools
Game Hacking ToolsTrainers & CheatsHack/Release NewsNew
Submit a release →Share your cheat, tool, or config with the community.
AINEW
AI Tools
General & DiscussionPrompt EngineeringLLM JailbreaksHotAI Agents & AutomationLocal / Open Models
AI × Gaming
AI Aimbots & VisionML Anti-CheatGame Bots & Automation
Create
AI Coding / Vibe CodingAI Art & MediaAI Voice & TTS
The AI frontier →Where game hacking meets modern machine learning. Jump in.
Marketplace
Buy & Sell
SellingBuyingTradingUser Services
Trust & Safety
Middleman LoungeMarketplace TalkVouch Copy Profiles
Money
Cryptocurrency TalkCurrency ExchangeWork & Job Offers
Start selling →List accounts, services, and goods. Use the middleman to trade safe.
MPGH The Dark Arts

A community for offensive security research, reverse engineering, and AI.

Community

ForumMarketplaceSearch

Account

RegisterLog in

Legal

Privacy PolicyForum RulesHelp & FAQ
© 2026 MPGH · All rights reserved.Built by the community, for the community. For educational purposes onlyContent is shared for security research and education — we don't condone illegal use. You're responsible for complying with applicable laws. Use at your own risk.
Home › Forum › Programming › Python Programming › Python Program to Calculate Sum/Avg of a Given Input

Python Program to Calculate Sum/Avg of a Given Input

Posts 1–2 of 2 · Page 1 of 1
Matthew
Matthew
Python Program to Calculate Sum/Avg of a Given Input
Coded in IDLE, program asks for the user to input numbers. Once done with the input it calculates the sum/avg of all of the inputted numbers

Code:
count = 0 #amount of numbers inputted
vSum = 0.0 #variable to track sum
average = 0.0 #variable to track average

data = input('Enter a number or press enter to quit:')
while data != '': #while data is actively being inputted it calculates the sum and count total
    number = float(data)
    count += 1
    vSum += number
    data = input('Enter a number or press enter to quit:') 
    average = vSum/count
if data == '': #once the enter key is hit, process stops and prints sum and average
    print('The sum is', vSum)
    print('The average is', average)
#1 · 5y ago
AR
Archangel_77
Shorter Version
Quote Originally Posted by Matthew View Post
Coded in IDLE, program asks for the user to input numbers. Once done with the input it calculates the sum/avg of all of the inputted numbers

Code:
count = 0 #amount of numbers inputted
vSum = 0.0 #variable to track sum
average = 0.0 #variable to track average

data = input('Enter a number or press enter to quit:')
while data != '': #while data is actively being inputted it calculates the sum and count total
    number = float(data)
    count += 1
    vSum += number
    data = input('Enter a number or press enter to quit:') 
    average = vSum/count
if data == '': #once the enter key is hit, process stops and prints sum and average
    print('The sum is', vSum)
    print('The average is', average)

values = list(map(float, input("Enter numbers separated by space: ").split()))
print(sum(values) / len(values))
#2 · 3mo ago
Posts 1–2 of 2 · Page 1 of 1

Post a Reply

Similar Threads

  • Paying for a short text based python programBy Braddy12 in Coders Lounge
    1Last post 11y ago
  • python program i need helpBy Darkenforcer22 in Coders Lounge
    4Last post 9y ago
  • ($15)Need Help with NLTK (Python Programming and a bit of regex) Chunking Sentences!.By JangoOlsen in Work & Job Offers
    0Last post 9y ago
  • Python Programming Homework (University, Intermediate level)By TallOne123 in Work & Job Offers
    0Last post 10y ago
  • Hacking Python programsBy boynedmaster in Coders Lounge
    0Last post 11y ago

Tags for this Thread

None