Is there a way to get rid of the syntax error when I run try and except?

BlamelessShoe79
    while True:
      try:
         a = float(input("Enter a number for how long the break between words should be:")
      except ValueError:
          print("YOu haven't entered a number")
  1. After I execute it:

     File "main.py", line 7
         except ValueError:
         ^
     SyntaxError: invalid syntax
    
  2. Why do I get this error?

Seth

You're missing a closing parenthesis at the end of this line:

a = float(input("Enter a number for how long the break between words should be:")

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

When I try to run my code with the "java" command in the cmd window, I get an error

When I try to run the Xcode simulator I get the error 'Stop “(null)”?'

When I try and run pyspark.cmd I get the error message "find: 'version': No such file or directory"

try except syntax error

I´m having the error #1241 in MySql when I try this syntax

For loop in macro works when I step through but get run-time error '91' when I try to run it

I get a syntax error when I try to use array map function in Google Scripts. Why?

Python Selenium - Invalid syntax error with try except

try:/except: returns a syntax error in Python when trying to run module

When I try to run this I get this error TypeError: list indices must be integers or slices, not list

React App: Why I get an error when I try to run npm start script?

Why did i get every time an Syntax error when i try to put an Variable in an Xpath

how to get rid of syntax error in try-catch block in nodejs

When I run the code chunks everything works but when I try to Knit I get an error

Try and except returns error, however when run without, no error occurs?

Why do I get a syntax error when I try to print a nested hash that has keys containing colons?

I get this error when I try to install

Error on jest when I try to run the test

Python try except finally invalid syntax error

When I try to run my application of submition data in SQLite there is an error 1 syntax error

Lua: I get error when I try to run a script in Windows

I get a syntax error when I try to send a discord message

Why do I get invalid syntax when I try to use pandas to run this code?

When I try to run my project on MAC terminal I get this error

Except function is always executed when I try and give it a specific error

when i try to run my project i get the error that says no module named flask

I get an error when I try to run yarn build in next.js

When ever I run MySQL query I get syntax error

How do I fix this syntax error on my Try and Except