我不確定這里是否真的有錯誤,但我(出于好奇)創建了一個程式來計算大約 241 代人中有多少人......假設在 Z 世代中只有一個人出生之前的親密關系,然后是在整個Z世代出生之前,有多少人有過親密關系。
前提條件:Z世代有7210萬人,一代能用25年。所有的關系都是一夫一妻制的。每對夫婦都有一個孩子。
import time
#I made this program out of pure curiousity (I'm not lewd, I promise) and I found it pretty interesting.
#Bunny art
print(" z")
print(" z")
print(" z")
print("(\(\ ")
print("(– -)")
print("(‘)(’)")
#Variable Declarations
generationLength = 25
totalYears = 6026
numberOfGenerations = totalYears / generationLength
numberOfCalculations = 0
numberOfPeople = 1
numberOfPeopleOnEarth = 7750000000
numberOfPeopleInThisGeneration = 72100000
def howManyPeopleHadSexBeforeICameIntoExistence():
#Mathematics
numberOfCalculations = 0
while (numberOfCalculations < numberOfGenerations):
numberOfPeople = numberOfGenerations * 2
numberOfCalculations = numberOfCalculations 1
#Output
time.sleep(2)
print("\nCalculating pointless knowledge...")
time.sleep(2)
print("At least " str(round(numberOfPeople)) " people in had sex before one person in Generation Z was born.")
#Mathematics
total = round(numberOfPeople * numberOfPeopleInThisGeneration)
#Output
time.sleep(2)
print("\nCalculating extra trivia...")
time.sleep(2)
print("At least " str(total) " had sex before every person in Generation Z was born.")
howManyPeopleHadSexBeforeICameIntoExistence()
uj5u.com熱心網友回復:
import time
# I made this program out of pure curiousity (I'm lewd, I promise) and I found it pretty interesting.
# Bunny art
print(" z")
print(" z")
print(" z")
print("(\(\ ")
print("(– -)")
print("(‘)(’)")
# Variable Declarations
generationLength = 25
totalYears = 6026
numberOfGenerations = totalYears / generationLength
numberOfPeopleOnEarth = 7750000000
numberOfPeopleInThisGeneration = 72100000
percentage_of_current_generation = numberOfPeopleInThisGeneration/numberOfPeopleOnEarth
max_age = 100
def howManyPeopleHadSexBeforeICameIntoExistence():
numberOfPeople = numberOfPeopleInThisGeneration * (2 ** numberOfGenerations) - numberOfPeopleInThisGeneration
# Output
time.sleep(2)
print("\nCalculating pointless knowledge...")
time.sleep(2)
print("At least " str(round(numberOfPeople)) " people in history had sex before one person in Generation Z was born.")
# Mathematics
total_alive = round(numberOfPeopleInThisGeneration * (2 ** (max_age/generationLength)) - 1)
# Output
time.sleep(2)
print("\nCalculating extra trivia...")
time.sleep(2)
print("At least " str(total_alive) " people currently alive had sex before every person in Generation Z was born.")
howManyPeopleHadSexBeforeICameIntoExistence()
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/449135.html
上一篇:特定值的冪運算子問題
下一篇:Java計算器程式問題
