Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Adding keys and values to a dictionary
Post: RE: Adding keys and values to a dictionary

(Nov-19-2020, 04:39 PM)bowlofred Wrote: Keys in a dictionary are unique, but the starting values you have are not unique. So simply reversing the order of values and keys gives a key collision. Wh...
giladal General Coding Help 3 2,531 Nov-19-2020, 04:56 PM
    Thread: Adding keys and values to a dictionary
Post: Adding keys and values to a dictionary

Hey Guys. Trying to add value, key in this order to a dictionary. Checking with the debugger it shows that index 0 is added to new_dict, and then in the second iteration, index 1 replaces index 0 and...
giladal General Coding Help 3 2,531 Nov-19-2020, 03:49 PM
    Thread: So simple yet not working....
Post: RE: So simple yet not working....

(Oct-26-2020, 11:10 PM)bowlofred Wrote: In your changed version, on line 5: temperature.replace() doesn't modify temperature. It returns the modified string. If you don't assign it to something (l...
giladal General Coding Help 13 4,283 Oct-27-2020, 07:05 AM
    Thread: So simple yet not working....
Post: RE: So simple yet not working....

(Oct-26-2020, 10:41 PM)giladal Wrote: (Oct-26-2020, 10:37 PM)Askic Wrote: When execute your code, I get this: Insert temperature: 35C 35 Insert temperature: 25f 25 So it appears it works, but the...
giladal General Coding Help 13 4,283 Oct-26-2020, 10:53 PM
    Thread: So simple yet not working....
Post: RE: So simple yet not working....

I re-wrote it with your suggestion. Still I get the F letter attached... temperature = (input("Insert temperature: ")) if "f" in temperature or "F" in temperature: temperature = temperature.uppe...
giladal General Coding Help 13 4,283 Oct-26-2020, 10:49 PM
    Thread: So simple yet not working....
Post: RE: So simple yet not working....

(Oct-26-2020, 10:37 PM)Askic Wrote: When execute your code, I get this: Insert temperature: 35C 35 Insert temperature: 25f 25 So it appears it works, but the general approach is not that good. What...
giladal General Coding Help 13 4,283 Oct-26-2020, 10:41 PM
    Thread: So simple yet not working....
Post: So simple yet not working....

Hi Guys. I am trying to remove the letter F or C or f or c from the string and then print it. Here is the code, and for the love of god, I don't understand what I am doing wrong. Its printing exactl...
giladal General Coding Help 13 4,283 Oct-26-2020, 10:19 PM
    Thread: Trying to play sound. Getting fatal error.
Post: Trying to play sound. Getting fatal error.

Hello guys. I am creating a space invader sort of game and for some reason when the sound of the shooting or explosion is heard, right after the programs quits fatal with the following errors. I sea...
giladal Game Development 1 2,168 Oct-23-2020, 01:59 PM
    Thread: Fatal error after trying to play sound.
Post: Fatal error after trying to play sound.

Hello guys. I am creating a space invader sort of game and for some reason when the sound of the shooting or explosion is heard, right after the programs quits fatal with the following errors. I sea...
giladal General Coding Help 0 1,943 Oct-22-2020, 10:27 AM
    Thread: Trying to install pygame Mac OS x high sierra
Post: Trying to install pygame Mac OS x high sierra

Hi Guys. Trying to install pygame on Mac OSX high sierra with no luck... Here is the message I get. Would love your help. 13 warnings and 2 errors generated. --- For help with compila...
giladal Game Development 2 2,776 Oct-18-2020, 05:31 PM
    Thread: Need help with a checkerboard algorythm
Post: RE: Need help with a checkerboard algorythm

(Sep-26-2020, 09:55 PM)bowlofred Wrote: Your parity is off. If you change the conditional to (x + y + 1)%2, it works. Or you could change your tests to be the reverse. That should work as well. W...
giladal General Coding Help 2 2,034 Sep-27-2020, 10:41 AM
    Thread: Need help with a checkerboard algorythm
Post: Need help with a checkerboard algorythm

Hey Guys, In the middle of a python course and unfortunately the course is off the air right now so I cant get help from the instructors. Hopefully I can get some help here. The chess() function get...
giladal General Coding Help 2 2,034 Sep-26-2020, 02:58 PM
    Thread: Need help...
Post: RE: Need help...

I got it.. I was looking at the wrong key... and thinking it was a decrypt and not encrypt. Anyways, solved. Thanks for your quick reply. :)
giladal General Coding Help 3 1,770 Sep-16-2020, 01:36 PM
    Thread: Need help...
Post: Need help...

For the love of god, cant understand why does this print the index of 18 for s which it is actually 7... Would appreciate any help. def encrypt_atbash(msg): alphabet = "abcdefghijklmnopqrstuvwxy...
giladal General Coding Help 3 1,770 Sep-16-2020, 12:48 PM
    Thread: What is the meaning of k in this function?
Post: RE: What is the meaning of k in this function?

Ohhh boy... Sorry for the question... of course k is an instance of range(2, n)... Makes sense. Highly appreciate your help buddy. G
giladal General Coding Help 3 2,755 Aug-15-2020, 12:18 PM
    Thread: What is the meaning of k in this function?
Post: What is the meaning of k in this function?

Dear all, I am in the process of learning python and going through the mod operator. I am having a hard time understanding what is the meaning of k in the following. Why does it decide k == 2? Highl...
giladal General Coding Help 3 2,755 Aug-15-2020, 11:52 AM

User Panel Messages

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