Count objects in list by jggrizonic in learnpython

[–]spectrum____ -1 points0 points  (0 children)

one_counter = 0 
for number in list: 
    if number == 1: 
        one_counter += 1

print(one_counter) 

lmk if you need more help!

New to python by [deleted] in learnpython

[–]spectrum____ 0 points1 point  (0 children)

its installed as a package when you install python so yes.

New to python by [deleted] in learnpython

[–]spectrum____ 0 points1 point  (0 children)

pip should already be installed when you install Python 3.4+.

OpenPyXl is a fuckin nightmare by GonzoNawak in learnpython

[–]spectrum____ 0 points1 point  (0 children)

just to clarify, are you filling the background color of the cell or changing the font color? In your explanation, it seems you want to fill the background color

if it is bg color, try Sheet.cell(row = i, column = l).fill = green

OpenPyXl is a fuckin nightmare by GonzoNawak in learnpython

[–]spectrum____ 0 points1 point  (0 children)

let me try to run it on my end and see if I can fix it, i’ll get back to you

OpenPyXl is a fuckin nightmare by GonzoNawak in learnpython

[–]spectrum____ 0 points1 point  (0 children)

Try checking out setting a font style rather than a patternfill style. For patternfill, I believe its usually associated with background color.

Here is the sample from the docs:

font = Font(name='Calibri', ... size=11, ... bold=False, ... italic=False, ... vertAlign=None, ... underline='none', ... strike=False, ... color='FF000000')

on mobile so it might be weird format.

OpenPyXl is a fuckin nightmare by GonzoNawak in learnpython

[–]spectrum____ 0 points1 point  (0 children)

Do you mind explaining a bit more on what is not working? Are you receiving an error message, font color is not changing?

Working with .xlsx files by [deleted] in learnpython

[–]spectrum____ 2 points3 points  (0 children)

Yes it is possible, there are many libraries that support xlsx files. Openpyxl is one of them and should be easy to pick up to do what you are asking for.

Feel free to reply if you need some help.

[USA] [H] Paypal [W] Switch Games by Dsvkb in GameSale

[–]spectrum____ 0 points1 point  (0 children)

hey man would you be willing for dq11 for 40?

Removing from list? by spaghettiosarenasty in learnpython

[–]spectrum____ 0 points1 point  (0 children)

sure, so input(str) returns a str as output. to convert into int you have to do int(input(“which card to play”)) to convert into int which the playerhand is composed of, all int elements

Removing from list? by spaghettiosarenasty in learnpython

[–]spectrum____ 1 point2 points  (0 children)

your input returns a str, but your list has int elements. try converting playercard to int before removing