Horje
find-squares-and-odd-numbers-in-the-given-list Code Example
find-squares-and-odd-numbers-in-the-given-list
def squareodd(num):
    #lst = () # 'tuple' object has no attribute 'append'
    lst = []
    for i in num:
        # if num % 2 == 1: # you are trying to use the % (modulo) operator on the list instead on item of list 
        if i % 2 == 1:
            lst.append(i**2)
    return lst




Python

Related
python send text Code Example python send text Code Example
save datetime day in seperate column Code Example save datetime day in seperate column Code Example
# enumerate Code Example # enumerate Code Example
print numbers with underscores python Code Example print numbers with underscores python Code Example
termcolor print python Code Example termcolor print python Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8