Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

I dont know whats wrong, SyntaxError: unexpected EOF while parsing

num1 = float(input())
num2 = float(input())

soma = (num1 * 3.5 + num2 * 7.5) / (2 * 10)

print(f'MEDIA = {soma.:5}')

…fails with:

RUNTIME ERROR
 File "<fstring>", line 1
(soma.)
^
SyntaxError: unexpected EOF while parsing

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Please visit this link for more info about string formatting in python

num1 = float(input())
num2 = float(input())

soma = (num1 * 3.5 + num2 * 7.5) / (2 * 10)

print(f'MEDIA = {soma:.5f}')

Output:

$ python3.10 main.py 
3
4
MEDIA = 2.02500
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading