Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Use a class type in it
Post: RE: Use a class type in it

(Jan-28-2023, 11:19 PM)Gribouillis Wrote: Use : "Player" instead of : Player. Ok it work now Thanks
MathisDELAGE General Coding Help 2 920 Jan-29-2023, 11:37 AM
    Thread: Use a class type in it
Post: Use a class type in it

Hello, I want to use a description for my parameter of my class method and that give this class Player: def __init__(self, name: str) -> None: self.name = name def battle(self, opp...
MathisDELAGE General Coding Help 2 920 Jan-28-2023, 10:03 PM
    Thread: Init an indefinite number of class
Post: RE: Init an indefinite number of class

(Feb-18-2022, 01:40 PM)dboxall123 Wrote: I don't understand what you're doing on that bottom line, couldn't you just do this?: players = [] for i in range(1, x+1): players.append(Player())Or may...
MathisDELAGE General Coding Help 9 2,323 Feb-18-2022, 06:46 PM
    Thread: Init an indefinite number of class
Post: RE: Init an indefinite number of class

(Feb-18-2022, 01:40 PM)dboxall123 Wrote: I don't understand what you're doing on that bottom line, couldn't you just do this?: players = [] for i in range(1, x+1): players.append(Player()) Thank...
MathisDELAGE General Coding Help 9 2,323 Feb-18-2022, 01:43 PM
    Thread: Init an indefinite number of class
Post: RE: Init an indefinite number of class

(Feb-18-2022, 01:35 PM)ndc85430 Wrote: You shouldn't be using exec, you should be storing the items in a collection (e.g. tuple, list, set, or dict as appropriate). I see thank you
MathisDELAGE General Coding Help 9 2,323 Feb-18-2022, 01:38 PM
    Thread: Init an indefinite number of class
Post: Init an indefinite number of class

Hello world, I need your help for my new game project. I want to use x(the number of player) time my class Player. I think do that but it's not optimum. from MyClass import Player x = int(input("Numb...
MathisDELAGE General Coding Help 9 2,323 Feb-18-2022, 01:20 PM
    Thread: equation
Post: equation

Hello, I'd like to fix an equation with this program is what it would be possible to please # coding:utf-8 équation = str(input("saisir une équation: ")) nb_inconnue = int(input("Saisir le nombre d...
MathisDELAGE General Coding Help 5 2,501 Nov-07-2019, 09:25 AM
    Thread: cacul in variable
Post: cacul in variable

hello, I'd like to do an operation in a variables like 1.calcul = input("enter a calculation: ") 2.x = 1 3.print(calcul) >>>enter a calculation: 4x+1 >>>4x+1 4x+1 is not the respo...
MathisDELAGE General Coding Help 2 1,764 Nov-06-2019, 05:18 PM

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020