def main():
birthRate = (60/7) # Births in a minute
deathRate = (60/13) # Deaths in a minute
immigrantRate = (60/45) # New immigrants in a minute
minutesInaYear = (24 * 60 * 365) # The number of seconds in a years
minutesInaLeapYear = (24 * 60 * 366)
currentPopulation = 312032486
totalRate = (birthRate - deathRate + immigrantRate)
populationIncreaseInaYear = (totalRate * minutesInaYear) # Calculates the increase in population after a year
populationInaYear = (currentPopulation + populationIncreaseInaYear) # Total population after a year
populationInTwoYears = (currentPopulation + (2 * populationIncreaseInaYear))
populationInThreeYears = (currentPopulation + (3 * populationIncreaseInaYear))
populationInFourYears = (currentPopulation + (4 * populationIncreaseInaYear))
populationInFiveYears = ((populationInFourYears + (totalRate * minutesInaYear))
print("The population after one year is: " , populationInaYear) '''PRINT FUNCTION DOESN'T WORK?'''
print("The population after two years is: " , populationInTwoYears)
print("The population after three years is: " , populationInThreeYears)
print("The population after four years is: " , populationInFourYears)
print("The population after five years is: " , populationInFiveYears)
main()
Warum funktioniert nicht drucken? Selbst wenn ich alles in der Klammer durch eine Zahl ersetze, sagt es, dass es beim "t" im Druck einen Syntaxfehler gibt. Was ist los?Syntaxproblem mit Drucken auf Python 3
Bitte vergewissern Sie sich, dass Ihr Beitrag vor der Veröffentlichung korrekt formatiert ist. In welcher Zeile tritt dieser Fehler auf? Was ist die genaue Nachricht? – usr2564301