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, 2022 in Python by Dev
• 6,000 points
806 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, 2022 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, 2022 in Python by CoolCoder
• 4,420 points
552 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,090 points

edited Dec 14, 2018 by Anirudh 1,622 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
717 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 4,391 views
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, 2022 in Python by Nandini
• 5,480 points
3,740 views
0 votes
1 answer

Is there a label/goto in Python?

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

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