Python error "SyntaxError: invalid syntax"

0 votes

I have a very simple python snippet:

from random import *

ip1 = input('Enter the N1 :')
ip2 = input('Enter the N2 :')

r = randint({0},{1}.format(ip1,ip2))

print r

But I get the following error:

File "", line 6
    r = randint({0},{1}.format(i1,i2))
SyntaxError: invalid syntax
Jul 5 in Python by Ruth

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Python

0 votes
1 answer

'Syntax Error: invalid syntax' for no apparent reason

You're missing a close paren in this ...READ MORE

answered Aug 13, 2018 in Python by Priyaj
• 56,160 points
0 votes
1 answer

How to fix this? ValueError: invalid literal for int() with base 10 error in Python

The following are totally acceptable in python: passing ...READ MORE

answered Nov 16, 2018 in Python by Nymeria
• 3,500 points
0 votes
0 answers

What exactly is invalid syntax error?

Isnt it same as a nameerror, there ...READ MORE

Jun 12 in Python by Waseem
• 3,480 points
+2 votes
2 answers

Error while printing hello world in python.

You must be trying this command in ...READ MORE

answered Mar 31, 2018 in Python by GandalfDwhite
• 1,320 points
0 votes
2 answers

Indentation Error in Python

Use tabs instead of spaces. This is ...READ MORE

answered Feb 14 in Python by Shashank
• 1,350 points
+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 6 in Python by Neha
• 330 points

edited Jul 8 by Kalgi 128 views
+4 votes
6 answers