Canada's annual rate of inflation rose to 4.0 percent in November from 3.4 percent in the previous month mainly due to higher prices for gasoline and new automobiles, the government said yesterday.

November marks the first time since July that the inflation rate is back up to the 4 percent range. After starting the year at 5.3 percent, inflation rose briefly then declined to 4.2 percent by July. In August it was down to 3.7 percent. It rose to 3.8 percent in September, then dropped to 3.4 percent in October.

The government agency Statistics Canada said prices for food remained relatively stable between October and November, but private transportation costs rose 2.4 percent -- both new car prices and gasoline prices.

The consumer price index compiled by Statistics Canada is based on a monthly survey of price changes in a fixed shopping basket of hundreds of consumer goods and services.

The index is based on 100 points being equal to the average price for these items in 1981. In November, the index was 124.0, up from 123.2 in October, 123.0 in September and 122.9 in August. That means the same goods and services that cost $100 in 1981 cost $124 last month, $123.20 in October and $123 in September.