Why am I getting a syntax error on offset_adjusted_list variable? [closed]

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



Why am I getting a syntax error on offset_adjusted_list variable? [closed]



My code is showing a syntax error over offset adjusted list variable. Why is this happening and how can I go about fixing this?



This question appears to be off-topic. The users who voted to close gave this specific reason:





Hint: count your (-s and )-s.
– ruakh
Aug 12 at 4:37


(


)





You are missing a closing bracket ()) on the end of the line offset = list(int(range(1, 27)).
– Jono 2906
Aug 12 at 4:40


)


offset = list(int(range(1, 27))





ruakh and jono2906 that worked. Thank you so much :)
– Maurice
Aug 12 at 4:44




2 Answers
2



Error Statement -1: list(int(range(1,27))



You have missed one closing bracket ')' in line offset = list(int(range(1,27))



Even after correction, there is error in code: range will return list of values, while int takes single numeral value, So int should not be use in this case.



After correction: list(range(1,27))



String Library



Error Statement -2: offset//2



Arithmetic operations can be applied in value of List, not on List as container





Thank you that was a good way of looking at it :)
– Maurice
Aug 12 at 5:46



you are missing a ")" in the line 3


offset = list(int(range(1,27)))



also range(1,27) gives you a list of numbers from 1..27 excluding 27.


[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26]



also you can on use a int() on a list input. It should be either number or a string.



there is no ascii attribute in string module. it should be ascii_lowercase


string.ascii_lowercase

((offset//2)+2)



above line should be like this


(len(offset) // 2) + 2)

Popular posts from this blog

Firebase Auth - with Email and Password - Check user already registered

Dynamically update html content plain JS

How to determine optimal route across keyboard