Mass percent and mole percent of a composition
Your approach in general looks OK except for

terminology (e.g. &quot;total grams&quot; should be total mass);
units (e.g. values provided for molar masses should have dimensions $\pu{g mol-1},$ not $\pu{g});$
excessive precision (you are given fractions with two significant figures, but there are mass values reported in your intermediate calculations having five significant digits; also, there is no need to calculate molar masses up to six significant figures — two would suffice);
math notations (&quot;textual formulas&quot; including chunks such as &quot;molar_mass&quot; or &quot;1.5 mol CO&quot; are not acceptable; use standardized symbols instead, e.g. $M$ or $n(\ce{CO}) = \pu{1.5 mol},$ correspondingly).

I was, however, taught to solve problems differently.
Solve the problem algebraically first, then plug in the physical quantities.
This way your solution becomes modular, generalized, and errors are easier to notice.
No imaginary &quot;set&quot; or &quot;fixed&quot; masses, volumes or other quantities introduced out of nowhere.
There is no point in intermediate calculations and they make tracking significant symbols harder than it should be.
Finally, assigning numerical indices to the compounds in the mixture saves you some time and paper, so let's do it now:
$$\underset{1}{\ce{H2}}\quad\underset{2}{\ce{CO}_\vphantom{}}\quad\underset{3}{\ce{CO2}}$$
and move on to the questions:

a) Calculate the mass% hydrogen if the mixture contains 15 mol% $\ce{CO}$ and no $\ce{CO2}.$

By definition, mass fraction of $i$-th component in the mixture is
$$ω_i = \frac{m_i}{\sum_j m_j}.\tag{1.1}$$
For a binary system with given mole fraction of the second component $x_2:$
$$ω_1 = \frac{m_1}{m_1 + m_2} = \frac{1}{1 + \frac{m_2}{m_1}} = \frac{1}{1 + \frac{x_2M_2}{(1 - x_2)M_1}} = \frac{1}{1 + \frac{0.15 × \pu{44 g mol-1}}{(1 - 0.15) × \pu{2.0 g mol-1}}} = 0.29.\tag{1.2}$$

b) Calculate the molar composition if the mass fraction of $\ce{CO}$ and $\ce{CO2}$ are both $0.35.$

By definition, mole fraction of $i$-th component in the mixture is
$$x_i = \frac{n_i}{\sum_j n_j} = \frac{m_i}{M_i\sum_j\frac{m_j}{M_j}} = \frac{ω_im}{M_i\sum_j\frac{ω_jm}{M_j}} = \frac{ω_i}{M_i\sum_j\frac{ω_j}{M_j}}.\tag{2.1}$$
Plugging in the corresponding quantities:
$$x_1 = \frac{0.30}{\pu{2.0 g mol-1} × \left(\frac{0.30}{\pu{2.0 g mol-1}} + \frac{0.35}{\pu{28 g mol-1}} + \frac{0.35}{\pu{44 g mol-1}}\right)} = 0.88 \tag{2.2.1};$$
$$x_2 = \frac{0.35}{\pu{28 g mol-1} × \left(\frac{0.30}{\pu{2.0 g mol-1}} + \frac{0.35}{\pu{28 g mol-1}} + \frac{0.35}{\pu{44 g mol-1}}\right)} = 0.07 \tag{2.2.2};$$
$$x_3 = \frac{0.35}{\pu{44 g mol-1} × \left(\frac{0.30}{\pu{2.0 g mol-1}} + \frac{0.35}{\pu{28 g mol-1}} + \frac{0.35}{\pu{44 g mol-1}}\right)} = 0.05 \tag{2.2.3}.$$
As you can see, using this approach takes less space and in my opinion is much more presentable.
Given you know elementary algebra and use standardized notations, you can greatly improve literacy of your answers and make them more concise.