aStr = input("Enter a string message: ")
fW = eval(input("Enter a positive integer: "))
print(f"Right aligned is <{aStr:>fW}>")
so, this is my code, I would like to align the spaces according to the user input. Whenever I try to use eval or int in fW, it shows this error.
Traceback (most recent call last):
File "C:\Users\vmabr\Downloads\A1Q2.py", line 5, in <module>
print(f"Right aligned is <{aStr:fW}>")
ValueError: Invalid format specifier
May I know what's the fix?