C# C# Collections Lists Lists

Mohammed Abdalla
Mohammed Abdalla
7,448 Points

Need help

Why I'm getting this error.

====================== MathHelpers.cs(11,35): error CS0103: The name Math' does not exist in the current context MathHelpers.cs(13,20): error CS0029: Cannot implicitly convert typeSystem.Collections.Generic.List' to `int' Compilation failed: 2 error(s), 0 warnings

MathHelpers.cs
using System.Collections.Generic;
namespace Treehouse.CodeChallenges
{
    public static class MathHelpers
    {
        public static int GetPowersOf2(int valuePassedIn)
        {
            List<int> powerOf2 = new List<int>();
            for(int i =1; i<= valuePassedIn; i++)
            {
                powerOf2.Add((int)Math.Pow(i, 2));
            }
            return powerOf2;
        }

    }
}

1 Answer

Mohammed Abdalla
Mohammed Abdalla
7,448 Points

Disregard it, I have fixed it Thanks