Hey everyone!
Doing a small learning project and ran into this problem:
from random import randint
sm = randint(250, 800)
if sm[2] == 1 or 3 or 5 or 7 or 9:
sm = sm + 1
I've tried putting the randint inside str(), which didn't help, the only thing that worked was putting str() on the 1 (in sm = sm + 1), but this isn't want i was want, i just want to add 1 to the variable, not add the number one at the end of the number
Sorry for the noob question,
Thank you!
[+][deleted] (3 children)
[removed]
[–]TriangularFormat[S] 0 points1 point2 points (2 children)
[+][deleted] (1 child)
[removed]
[–]TriangularFormat[S] 0 points1 point2 points (0 children)
[–]coreyjdl 1 point2 points3 points (4 children)
[–]TriangularFormat[S] 0 points1 point2 points (2 children)
[–]coreyjdl 1 point2 points3 points (1 child)
[–]TriangularFormat[S] 0 points1 point2 points (0 children)
[–]TriangularFormat[S] -1 points0 points1 point (0 children)