Feb-02-2020, 09:25 PM
I was kind of confused at the beginning because your program has a huge problem which would result in a TypeError not a SyntaxError, took me some moments to see, that you are missing a ) in line 3.
The next problem you will run into is that the + operator is not allowed between strings and numbers, so "test: " + 1 will result in a TypeError, there are different approaches to get the number in the string. The best one would be format.
The next problem you will run into is that the + operator is not allowed between strings and numbers, so "test: " + 1 will result in a TypeError, there are different approaches to get the number in the string. The best one would be format.
print(f"The monthly rent amount is {x * 52 / 12}")here the part between the curly brackets will be filled with your calculation and you do not have to worry about the data type you are putting in there. The easiest way, at least at the beginning would be to cast the value you are recieving to string
print("The monthly rent amounnt is " + str(x * 52 / 12))