Search Results
|
Post |
Author |
Forum |
Replies |
Views |
Posted
[asc]
|
|
|
Thread: Pre-release practice help!
Post: RE: Pre-release practice help!
I think you need to declare your total_kg and rejected variables before the bag_check function, then use them globally, like this:
total_kg = 0
rejected = 0
def bag_check(material, weight, total_kg, r... |
|
Lux |
Homework |
3 |
3,422 |
Nov-05-2017, 12:41 PM |
|
|
Thread: PLayer vs.PLayer game
Post: RE: PLayer vs.PLayer game
The problem is that you have a 'while' loop (the one at the end) that executes based on the value of a variable (if value is 1, 2, or 3) but doesn't change the variable, so the loop will just repeat c... |
|
Lux |
Homework |
1 |
3,086 |
Nov-04-2017, 08:33 PM |
|
|
Thread: adding a number to the list
Post: RE: adding a number to the list
Well, you have your number input outside of the loop, and declare your list after it's done executing. For what you described, the basic structure of your program might look like this:
MyList = []
whi... |
|
Lux |
Homework |
4 |
3,940 |
Nov-04-2017, 08:25 PM |
|
|
Thread: Homework Teacher isnt helping need some help
Post: RE: Homework Teacher isnt helping need some help
The 'len' function takes a string as an input and returns the length of the string. In the last line, you used the number 3 as an input to len(), which doesn't work because 3 is not a string.
If you... |
|
Lux |
Homework |
2 |
2,937 |
Nov-04-2017, 07:44 PM |
|
|
Thread: Beginner question
Post: RE: Beginner question
You have the right idea with a 'while' loop, but you want your code to repeat until they give an acceptable answer. If you're only looking for "Forward", your code might look like this:
while not dir1... |
|
Lux |
General Coding Help |
4 |
3,260 |
Nov-03-2017, 06:46 PM |
|
|
Thread: try and except
Post: RE: try and except
try/except is designed to handle errors- your except code will only run if your code has an error. You can check this by taking out the try/except to see what happens. I'm not positive, but it looks l... |
|
Lux |
Homework |
3 |
2,743 |
Oct-30-2017, 09:26 PM |
|
|
Thread: Clarification
Post: RE: Clarification
input() is a function that gets text input from the user. str() is a function that converts values to the 'String' type, just like int() converts values to integers.
If you used name = str("What is y... |
|
Lux |
General Coding Help |
2 |
2,927 |
Oct-29-2017, 11:40 PM |
|
|
Thread: Im embarresed to ask, but Im stuck
Post: RE: Im embarresed to ask, but Im stuck
I tried running the code on my computer and it didn't give me any errors... |
|
Lux |
GUI |
5 |
4,750 |
Oct-29-2017, 01:00 PM |
|
|
Thread: Password Guesser Project
Post: RE: Password Guesser Project
I tried running the code. I'm not sure why, but your 'guess' string seems to have a length of 0 at that point.
Sidenote- why are you using guess[0]? guess is a string, you could just set its value... |
|
Lux |
General Coding Help |
17 |
11,300 |
Oct-29-2017, 01:54 AM |
|
|
Thread: How to define a method in a class
Post: RE: How to define a method in a class
I think it needs to be called like this: self.dec3hex2(10) |
|
Lux |
GUI |
2 |
4,725 |
Oct-29-2017, 01:40 AM |
|
|
Thread: Password Guesser Project
Post: RE: Password Guesser Project
I think you need to write True- it has to be capital |
|
Lux |
General Coding Help |
17 |
11,300 |
Oct-22-2017, 09:21 PM |
|
|
Thread: Online IDE GUI problems
Post: RE: Online IDE GUI problems
|
Lux |
General Coding Help |
6 |
5,374 |
Oct-22-2017, 09:19 PM |
|
|
Thread: Online IDE GUI problems
Post: RE: Online IDE GUI problems
I'm doing this online, on a VM. It doesn't give me an error if I just write import tkinter. However, if I add root = tkinter.Tk(), I get an error:
Error:Traceback (most recent call last):
File "/hom... |
|
Lux |
General Coding Help |
6 |
5,374 |
Oct-22-2017, 09:17 PM |
|
|
Thread: Online IDE GUI problems
Post: Online IDE GUI problems
I am working on a project in python, and I was trying to use cloud9 to run it online. Unfortunately, my project uses tkinter, which doesn't seem to work in c9. Is there any way to get it to run? I've ... |
|
Lux |
General Coding Help |
6 |
5,374 |
Oct-22-2017, 09:09 PM |
|
|
Thread: Password Guesser Project
Post: RE: Password Guesser Project
I think you could do less than or equal to <= or just i < (len(AlphaNum) + 1) |
|
Lux |
General Coding Help |
17 |
11,300 |
Oct-22-2017, 02:55 PM |
|
|
Thread: Beginner
Post: RE: Beginner
Did you mean to write 0.10 instead of 0,10? (period instead of comma) |
|
Lux |
General Coding Help |
4 |
3,681 |
Oct-13-2017, 07:28 PM |
|
|
Thread: Not Outputting
Post: RE: Not Outputting
I tried running this code, and it only works when the two squares are the same color- that's because you need to fix your if/else structure. The outer if/else has 3 blocks, which basically come down t... |
|
Lux |
Homework |
3 |
4,709 |
Oct-13-2017, 07:23 PM |
|
|
Thread: Beginner
Post: RE: Beginner
Can you show what error message you are getting? And please use code tags around your code |
|
Lux |
General Coding Help |
4 |
3,681 |
Oct-13-2017, 07:15 PM |
|
|
Thread: Lots of code. Creating modules
Post: RE: Lots of code. Creating modules
When you import a module, it has different functions within it. If you look at your usage of the math module, you are using math.sqrt, not just sqrt. You should do the same thing with your imports fro... |
|
Lux |
Homework |
2 |
2,878 |
Oct-12-2017, 11:21 PM |
|
|
Thread: Import problems
Post: Import problems
I am trying to use python-docx, but I can't get it to import. I'm pretty sure it's installed- if I do pip install python-docx, I get the message: Requirement already satisfied: python-docx in /Library... |
|
Lux |
General Coding Help |
2 |
3,120 |
Oct-07-2017, 05:49 PM |