Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Changing dictionary values not working
Post: RE: Changing dictionary values not working

Sorry for wasting your time. I figured out what was wrong. I put kenyan_sand_boa["blah blah blah"] == new valueI was supposed to put kenyan_sand_boa["blah blah blah"] = new value
SnekLover123 General Coding Help 5 3,998 Nov-01-2017, 05:18 PM
    Thread: Changing dictionary values not working
Post: Changing dictionary values not working

I'm making a text game, and for the crafting part, it seems to be working, but when I view the inventory, nothing changed. I can't see why it's ignoring the kenyan_sand_boa["blah blah blah"] = new val...
SnekLover123 General Coding Help 5 3,998 Nov-01-2017, 04:46 PM
    Thread: TypeError: unsupported operand type(s) for -: 'int' and 'instancemethod'
Post: RE: TypeError: unsupported operand type(s) for -: ...

(Oct-05-2017, 06:29 PM)nilamo Wrote: A function defined in the class is already bound to the instance.  You call it just as you would any function, with parentheses.>>> class Spam: ...   de...
SnekLover123 Game Development 5 13,233 Oct-05-2017, 07:39 PM
    Thread: TypeError: unsupported operand type(s) for -: 'int' and 'instancemethod'
Post: RE: TypeError: unsupported operand type(s) for -: ...

(Oct-05-2017, 05:45 PM)DeaD_EyE Wrote: In line 38 you define the attribute sneek_width without any effect, because it's not bound to the instance nor to the class. In line 44 you define a method sne...
SnekLover123 Game Development 5 13,233 Oct-05-2017, 06:18 PM
    Thread: TypeError: unsupported operand type(s) for -: 'int' and 'instancemethod'
Post: TypeError: unsupported operand type(s) for -: 'int...

I'm trying to program a snake that's controlled by WASD keys and has collision detection. I also want it to turn in the direction it's moving. If you see any bugs or ways to optimize my code, please t...
SnekLover123 Game Development 5 13,233 Oct-05-2017, 05:20 PM
    Thread: NameError: name is not defined
Post: RE: NameError: name is not defined

(Sep-25-2017, 08:46 PM)ichabod801 Wrote: Refactoring is basically reorganizing your code. The problem is the if/elif/else structure of your code. If you structured your code differently, you wouldn'...
SnekLover123 General Coding Help 8 15,915 Sep-26-2017, 02:55 AM
    Thread: NameError: name is not defined
Post: RE: NameError: name is not defined

(Sep-25-2017, 08:08 PM)buran Wrote: refactor your code. How do I do that? (Sep-25-2017, 08:08 PM)buran Wrote: refactor your code. look at https://python-forum.io/Thread-Text-Adventure-Tutorial Wh...
SnekLover123 General Coding Help 8 15,915 Sep-25-2017, 08:10 PM
    Thread: NameError: name is not defined
Post: RE: NameError: name is not defined

(Sep-25-2017, 08:03 PM)buran Wrote: if biome is not 1, when it reach line 54 your script doesn't know what DSC is and what the value is..So what should I do?
SnekLover123 General Coding Help 8 15,915 Sep-25-2017, 08:04 PM
    Thread: NameError: name is not defined
Post: NameError: name is not defined

I'm really new to python. Can someone help me figure out what's wrong with my crappy game? It says NameError: name 'DSC' is not defined on line 55 in main.py import time import os name = raw_input(""...
SnekLover123 General Coding Help 8 15,915 Sep-25-2017, 07:58 PM
    Thread: Help with conditional statement
Post: RE: Help with conditional statement

(Sep-25-2017, 02:12 AM)ichabod801 Wrote: You are using the 'or' operator incorrectly. Please read this. And please post your code in python tags in the future. See the BBCode link in my signature be...
SnekLover123 General Coding Help 2 3,217 Sep-25-2017, 02:36 AM
    Thread: Help with conditional statement
Post: Help with conditional statement

My friend and I are creating a terrible game, and for picking the biome, it acts like I chose 1 no matter what I choose. What am I doing wrong? import pygame import time import os name = raw_input(...
SnekLover123 General Coding Help 2 3,217 Sep-25-2017, 01:49 AM

User Panel Messages

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