Validating initial inputs then a joint validation test
You should write a function that takes care of asking the user for input. It should be able to assign a type and validate the input. This way you can continue asking for a valid input for each of the variables independently. It also allows you to validate the second variable using the value of the first.
def ask_user(message, type_=str, valid=lambda x: True, wrong_type=&quot;Wrong type!&quot;, invalid=&quot;Invalid!&quot;):
    while True:
        try:
            x = type_(input(message))
        except (TypeError, ValueError):
            print(wrong_type)
            continue
        if valid(x):
            return x
        else:
            print(invalid)

Which you can use like this:
if __name__ == &quot;__main__&quot;:
    r_x = 0.15
    r_y = 0.21
    w_x = ask_user(&quot;Enter the weight of stock x in your portfolio: &quot;,
                   type_=float,
                   wrong_type=&quot;Please enter the weight using numbers&quot;,
                   valid=lambda w_x: 0 &lt;= w_x &lt;= 1,
                   invalid=&quot;Please enter the number as a decimal. Remember, your maximum investment is 100%.&quot;)
    w_y = ask_user(&quot;Enter the weight of stock y in your portoflio: &quot;,
                   type_=float,
                   wrong_type=&quot;Please enter the weight using numbers&quot;,
                   valid=lambda w_y: 0 &lt;= w_x + w_y &lt;= 1,
                   invalid=&quot;Remember, the total weight of the portfolio is 100%. The weights should add to 1.&quot;)
    r_p = r_x * w_x + r_y * w_y
    print(f&quot;The total return on your portoflio is {r_p:.2%}&quot;)

I also used the newer f-strings for string formatting, with the % format code, which takes care of that multiplication by one hundred. I also added a if __name__ == &quot;__main__&quot;: guard to allow importing from this script without the code being run.
Python has an official style-guide, PEP8. It recommends using spaces around = when using it for assignment, but not when using it for keyword arguments. Similarly, operators like + and * should generally also be surrounded by spaces.

If you want to be able to input n weights, I would add another function:
def ask_n_weights(message, n, type_=str, wrong_type=&quot;Wrong type!&quot;, invalid=&quot;Invalid!&quot;):
    weights = []
    for i in range(1, n + 1):
        weights.append(ask_user(message.format(i),
                                type_=type_,
                                wrong_type=wrong_type,
                                valid=lambda w: 0 &lt;= w + sum(weights) &lt;= 1,
                                invalid=invalid))
    return weights

This uses the fact that sum([]) = 0 to also be correct for the first variable. In order not to loose the ability to know which weight you are entering I made it so that message should have one placeholder:
ask_n_weights(&quot;Enter weight {}: &quot;, 4, type_=float)
# Enter weight 1: 0.25
# Enter weight 2: 0.25
# Enter weight 3: 0.25
# Enter weight 4: 0.25
# [0.25, 0.25, 0.25, 0.25]

You could also take an iterable of variable names instead of n.