I am new and trying my hands on python. I wrote a program in python and when I execute I get errors. Can anyone please help me?
Program:
first = raw_input("Enter the first no:")
second = raw_input("Enter Second no:")
if first <= 0:
print "Enter a valid number"
if second <= first:
print "Sencond number should be greater than first"
for x in range(first,second):
for i in range(2, i):
if x % i == 0:
j = x/i
print x, " is not a prime no"
print "%d = %d*%d" % (x, i, j)
break;
else:
print x, " is not a prime number"
Input and error:
Enter the first no:1
Enter Second no:9
Traceback (most recent call last):
File "today1.py", line 7, in <module>
for x in range(first,second):
TypeError: range() integer end argument expected, got str.
Thank you in advance.
int()comes to mind)