Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Better way to write this function
Post: Better way to write this function

Hello I have created a rock paper scissors game, it works fine but one function is very long and I was wondering if maybe there was a better way to write it def check_who_won(self): self.pr...
SephMon General Coding Help 1 789 Feb-08-2023, 11:21 AM
    Thread: Enum help
Post: RE: Enum help

Thanks for replying from abc import ABC,abstractmethod import itertools from enum import Enum, auto class Employee(ABC): employee_id = itertools.count(1000) def __init__(self,fir...
SephMon General Coding Help 3 1,469 Nov-19-2021, 12:00 AM
    Thread: Enum help
Post: Enum help

How can I pass an Enum into a constructor of a class? so the children classes can use it as well class Employee(ABC5): employee_id = itertools.count(1000) def __init__(self,first_...
SephMon General Coding Help 3 1,469 Nov-18-2021, 12:13 PM
    Thread: Deleting employee from list
Post: RE: Deleting employee from list

Thanks for replying but I get an error "AttributeError list object has no attribute firstName"
SephMon General Coding Help 3 3,199 Jan-05-2021, 12:13 AM
    Thread: Deleting employee from list
Post: Deleting employee from list

Can anyone tell me please why my delete_employee() function doesn't actually delete an employee from the list, I'm banging my head against a wall all day trying to get it to work. class Employee(obje...
SephMon General Coding Help 3 3,199 Jan-04-2021, 11:29 PM
    Thread: Method not printing total or average
Post: RE: Method not printing total or average

Thank a lot for your help
SephMon General Coding Help 2 1,695 Sep-02-2020, 10:37 PM
    Thread: Method not printing total or average
Post: Method not printing total or average

The list is populated with user input but it doesn't print out the total when it sums all the numbers or average of list list = [] total = 0 num = 0 keep_going = True def get_input(): while k...
SephMon General Coding Help 2 1,695 Sep-02-2020, 09:54 AM
    Thread: Abstract classes
Post: RE: Abstract classes

(Aug-29-2020, 06:32 PM)snippsat Wrote: Can also mention this bye Raymond which is good intro to OOP in Python. Python's Class Development Toolkit That second video is great thanks, so essentially py...
SephMon General Coding Help 8 3,042 Aug-29-2020, 09:28 PM
    Thread: Abstract classes
Post: RE: Abstract classes

(Aug-29-2020, 04:20 PM)Gribouillis Wrote: Well Java classes are full of Java-specific turns of code. For example Java uses getters and setters which python most of the time does not, Java code is fu...
SephMon General Coding Help 8 3,042 Aug-29-2020, 06:17 PM
    Thread: Abstract classes
Post: RE: Abstract classes

(Aug-29-2020, 10:57 AM)Gribouillis Wrote: , my advice is not to imitate Java when you write python classes, especially in the beginning. Could you elaborate on this please?
SephMon General Coding Help 8 3,042 Aug-29-2020, 03:43 PM
    Thread: Abstract classes
Post: Abstract classes

Can you make classes abstract in python?
SephMon General Coding Help 8 3,042 Aug-29-2020, 09:53 AM
    Thread: function not giving back total
Post: function not giving back total

Hello there New to python, I have a background in java, I'm finding oop in python confusing, this program simply prints out employee info and its suppose calculate their wage, when I run the program ...
SephMon General Coding Help 1 1,642 Aug-25-2020, 11:42 AM

User Panel Messages

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