Search Results
|
Post |
Author |
Forum |
Replies |
Views |
Posted
[asc]
|
|
|
Thread: My else clause doesn't work (general help)
Post: RE: My else clause doesn't work (general help)
Quote:Also equivalent to if day_inp >= 7. I think you meant if 1 <= day_inp <= 7.
now you are saying that if the day is between 1 and 7, it's invalid. The typo in the original would be 1 <... |
|
tozqo |
General Coding Help |
10 |
7,986 |
Jul-16-2017, 11:01 PM |
|
|
Thread: Hey guys can you please help me with some basic coding
Post: RE: Hey guys can you please help me with some basi...
Thanks for the clarification on that ichabod. It is very helpful with reading code understanding the syntax and style.
Quote:I get an error if I set the user and comp outside the game function.
def f... |
|
tozqo |
General Coding Help |
9 |
6,288 |
Jul-16-2017, 05:59 AM |
|
|
Thread: My else clause doesn't work (general help)
Post: RE: My else clause doesn't work (general help)
What previous posters didn't include is why you get that output.
for number, name in days: means for every number, name value in days it will print name if your input equals number, else it will prin... |
|
tozqo |
General Coding Help |
10 |
7,986 |
Jul-16-2017, 01:55 AM |
|
|
Thread: Hey guys can you please help me with some basic coding
Post: RE: Hey guys can you please help me with some basi...
Another way to explain it, and the way I finally understood it when first learning logic circuits: Or means "any must be," and means "all must be." In your case, no matter how many are > 10, as lo... |
|
tozqo |
General Coding Help |
9 |
6,288 |
Jul-16-2017, 12:22 AM |
|
|
Thread: Same codes show different output ?
Post: RE: Same codes show different output ?
So you're saying that using PyCharm in Python 2.x version mode will try to interpret your Python 3.x code differently than using PyCharm in 3.x mode. Just because SuperSymmetry has Python 3 installed ... |
|
tozqo |
General Coding Help |
12 |
8,790 |
Jul-15-2017, 10:30 PM |
|
|
Thread: Same codes show different output ?
Post: RE: Same codes show different output ?
Using 2.x could explain the syntax errors. I'm egocentric and just assume everyone is using the same version of Python that I have. All my tests were run using Python 3.x in IDLE, and sparkz_alot's si... |
|
tozqo |
General Coding Help |
12 |
8,790 |
Jul-11-2017, 03:43 AM |
|
|
Thread: Trying to figure out how list comprehensions work
Post: RE: Trying to figure out how list comprehensions w...
So, based on what I am reading from ya'll, I am making a list of lists. This I should have already been able to figure out from previous reading. In this case, matrix is a list of 3 lists, and each li... |
|
tozqo |
General Coding Help |
4 |
4,030 |
Jul-11-2017, 03:27 AM |
|
|
Thread: Trying to figure out how list comprehensions work
Post: Trying to figure out how list comprehensions work
Working through the docs cause I'm too broke to get traditional learning, and I'm at 5.1.4. Nested List Comprehensions.
the example in the docs is
matrix = [
[1, 2, 3, 4],
[5, 6, 7, 8],
[9, 10, 11, 1... |
|
tozqo |
General Coding Help |
4 |
4,030 |
Jul-10-2017, 08:51 AM |
|
|
Thread: Same codes show different output ?
Post: RE: Same codes show different output ?
2nd one works for me too. Either you got a haunted IDLE process, or a typo in your input. Oddly, the same thing happened to me when I tried doing my first calculator a few weeks ago. If you do a dive,... |
|
tozqo |
General Coding Help |
12 |
8,790 |
Jul-10-2017, 08:17 AM |
|
|
Thread: I need a win! (HELP!) PLZ?
Post: RE: I need a win! (HELP!) PLZ?
Actually it looks like everything is good, except your forgot to call win(). Or I guess more accurately, you are removing the print function from win(), or only allowing the 2nd print function in gam... |
|
tozqo |
Homework |
17 |
9,393 |
Jul-10-2017, 04:14 AM |
|
|
Thread: Word generator
Post: RE: Word generator
On topic: I'd suggest import random, use some sort of bool() and run it four times, if all are false, do again. For each true, pick a random num from the ascii range for vowels, for each false, pick a... |
|
tozqo |
Homework |
10 |
151,870 |
Jul-03-2017, 03:07 AM |
|
|
Thread: Docs missing info?
Post: RE: Docs missing info?
Fixed my typo to have the correct number of quotes, and it worked. I remember putting \n and \b in quotes, and getting the error, but I have alot of times where I have missed things I thought I hadn't... |
|
tozqo |
News and Discussions |
3 |
4,447 |
Jun-20-2017, 01:03 PM |
|
|
Thread: Docs missing info?
Post: Docs missing info?
I watched "Python Programming" by Derek Banas on YouTube, he mentions newlines, and I decide to play around with it a little
print('hello', \n, 'world)being the simplest example. I run the code expec... |
|
tozqo |
News and Discussions |
3 |
4,447 |
Jun-20-2017, 11:07 AM |
|
|
Thread: saving my *.py files
Post: saving my *.py files
So, (possibly off topic) if I have been saving my *.py files to anywhere other than where I installed my Python, then I won't be able to import them to the module I am working on? |
|
tozqo |
General Coding Help |
2 |
3,598 |
Jun-20-2017, 10:25 AM |
|
|
Thread: trying an online challenge
Post: RE: trying an online challenge
So that tells me what version of python the site uses. I was getting syntax errors for end='' I use python 3.6 and when testing my code it worked great, and I was so confused why they had a syntax err... |
|
tozqo |
Homework |
8 |
5,959 |
Jun-20-2017, 10:01 AM |
|
|
Thread: trying an online challenge
Post: RE: trying an online challenge
I finally figured out how the website works and the code that passed the challenge is:
def FirstFactorial(num):
n = num - 1
while n>0:
num = num+n
n = n-1
return num
print ... |
|
tozqo |
Homework |
8 |
5,959 |
Jun-18-2017, 03:34 AM |
|
|
Thread: trying an online challenge
Post: RE: trying an online challenge
So, I'm really close but haven't grasped a concept for this yet. I'll keep reading and learning and try it out again later. |
|
tozqo |
Homework |
8 |
5,959 |
Jun-14-2017, 07:04 AM |
|
|
Thread: trying an online challenge
Post: RE: trying an online challenge
The "input" range they mention is actually the test parameters. It doesn't just test one value, it tests 1 through 10. The site calls them inputs, but as you can see from my code and the results of th... |
|
tozqo |
Homework |
8 |
5,959 |
Jun-13-2017, 07:32 AM |
|
|
Thread: trying an online challenge
Post: trying an online challenge
I recently started learning Python. I have watched several YouTube vids, read some documentation, and experimented on my own. I'm currently trying to complete the first challenge for a website(not abl... |
|
tozqo |
Homework |
8 |
5,959 |
Jun-12-2017, 11:38 AM |
|
|
Thread: input defines variable but it's not defined
Post: RE: input defines variable but it's not defined
Thanks for the globals advice. I added the calls, found out that it was doing the input() function twice(once for the global and once for the compute() call) and fixed that and found out that the vari... |
|
tozqo |
General Coding Help |
5 |
7,282 |
Jun-05-2017, 02:45 AM |