Use external variables in for to prompt Shadows name 'count' from outer scope

there"s nothing wrong with running, but I"m confused about why I"m prompted for this, pycharm

.

Oct.19,2021

is not a big deal, pycharm is just worried about the risk that a variable name you intended to use inside the for loop ends up in global, and then you accidentally use the variable somewhere else, and an error occurs later.

the simple solution is to put the variables in the process to be used inside the function, similar to:

def print_data(data):
    print data

def main():
    data = [4, 5, 6]
    print_data(data)

main()

explain in detail: How bad is shadowing names defined in outer scopes?

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b39b80-2ba02.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b39b80-2ba02.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?