syntaxerror unexpected character after line continuation character in python math

0 votes

I am having problems with this Python program I am creating to do maths, working out and so solutions but I'm getting the syntaxerror: "unexpected character after line continuation character in python"

this is my code

print("Length between sides: "+str((length*length)*2.6)+" \ 1.5 = "+str(((length*length)*2.6)\1.5)+" Units")

My problem is with \1.5 I have tried \1.5 but it doesn't work

Feb 16 in Python by Dev
• 6,000 points
29 views

1 answer to this question.

0 votes

There is a slight confusion as both backslash / and division \ sign are used,
The correct code will be:

print("Length between sides: "+str((length*length)*2.6)+" \ 1.5 = "+str(((length*length)*2.6)/1.5)+" Units")

Hope this helps!

answered Feb 16 by Nandini
• 5,480 points

Related Questions In Python

0 votes
1 answer

syntaxerror: "unexpected character after line continuation character in python" math

The division operator is /, not \ READ MORE

answered Feb 16 in Python by CoolCoder
• 4,360 points
11 views
0 votes
1 answer

What's the right way to concatenate files and appending the New Line character in Python? Text or binary mode?

It seems like you're using the wrong ...READ MORE

answered Nov 13, 2018 in Python by Anirudh
• 2,080 points

edited Dec 14, 2018 by Anirudh 730 views
0 votes
0 answers

How to do line continuation in python?

Is it same as the other programming ...READ MORE

May 30, 2019 in Python by Waseem
• 4,540 points
243 views
0 votes
2 answers
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 7, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 2,755 views
0 votes
1 answer
0 votes
1 answer

What does "SyntaxError: Missing parentheses in call to 'print'" mean in Python?

This error is generated when one is ...READ MORE

answered Feb 14 in Python by Nandini
• 5,480 points
95 views
0 votes
1 answer

Is there a label/goto in Python?

Since Python is a structured programming language, ...READ MORE

answered Feb 4 in Python by Nandini
• 5,480 points
13 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP