Category : syntax

Here i’m using regex (regular expression) in Pnadas. NIFTY30DEC219000CE.NFO NIFTY30DEC2116000CE.NFO NIFTY30DEC2116000CE NIFTY30DEC2116111PE NIFTY30DEC218100PE I have this type of string, in which ‘9000’ which is 4 digit character or 16000 or 5 digit character, as same as more. And Output should be- 9000 16000 16000 16111 8100 And I don’t need this 30DEC21 in output. Syntax ..

Read more

I thought trying to draw this thing in kenyan colours. Thought it would be simple and quick but ran into errors on the second line. import turtle pen=turtle.Turtle() pen.speed(‘fastest’) When I take out the second line the error appears on the third line. What am I doing wrong? turtle.bgcolor(‘black’) col=(‘black’,’white’,’red’,’white’,’green’) That’s what I’m trying to ..

Read more

This is a piece of my code: RandomNumber2 = round(random.uniform(0,1),0) NegativeOrNot_n2 = NegativeOrNotList[int(RandomNumber2)] n1 = round((random.uniform(nmin, nmax)*float(NegativeOrNot_n1)),1) n2 = round((random.uniform(sqrt(n1),10*sqrt(n1)),1) answer = (round(n2/n1), 2)) print("Guess", n2,"divided by", n1) And it randomly tells me syntax error when I define the answer answer = (round(n2/n1), 2)) ^ Can anybody help me? Source: Python-3x..

Read more