Home > front end >  Loop through parameter inputs
Loop through parameter inputs

Time:01-05

I want to run the same command with different values for the input, but cannot figure out how to loop them. I am using the TroPyCal module for tropical cyclone analysis.

What I want to do is the following:

basin.get_season(1970)
basin.get_season(1971)
basin.get_season(1972)

and so on for the years 1970-2020. But unsure how to create a loop for this (or if it is possible).

CodePudding user response:

use a for loop to iterate over the years 1970 to 2020 and call the get_season:

for year in range(1970, 2021):
    basin.get_season(year)
  • Related