Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: question about recursion
Post: RE: question about recursion

Solved it myself. Here is the solution: class Real(object): def __init__(self, r = 0): self.r = r def __str__(self): return "%18.15f" % (self.r,) def sqrt(self): ...
kotter Homework 1 2,056 Jan-19-2020, 01:00 PM
    Thread: question about recursion
Post: question about recursion

Hello, I was making an old exam but I am currently stuck on one question. I need to implement a class for real numbers. The class has one attribute, r, which is a float. In the class I need to approx...
kotter Homework 1 2,056 Jan-19-2020, 10:32 AM
    Thread: Write function to find decryptionkey
Post: RE: Write function to find decryptionkey

Assignment: Implement the function DecryptionKey(key). This function returns new_key created from the encryption key stored in key. The new key must be the key used to decrypt a text that was encrypte...
kotter Homework 3 3,055 Dec-05-2019, 01:56 PM
    Thread: Write function to find decryptionkey
Post: Write function to find decryptionkey

I have the following assignment: [inline]Say we have a random string containing only small letters. Then we have a key that encrypts the string. An example of such a key could be for example (but it ...
kotter Homework 3 3,055 Dec-05-2019, 12:19 PM
    Thread: code help
Post: RE: code help

Hint: I believe using modulus could be helpful in this problem.
kotter Homework 9 3,687 Jun-13-2019, 11:47 AM
    Thread: List Overlap
Post: RE: List Overlap

I believe your fourth line is wrong. You have: c = [i for i in a if a in b]But it should be: c = [i for i in a if i in b]Edit: This was already said, never mind
kotter Homework 4 2,577 Jun-12-2019, 03:23 PM
    Thread: assignment help
Post: RE: assignment help

Here is task 1. I understood that 7 needs to be included in the list. The other tasks you can try by yourself. Code removed https://python-forum.io/misc.php?action=help&hid=52 Wrote:Do not post so...
kotter Homework 4 6,672 Jun-11-2019, 05:08 PM
    Thread: Having two inputs to escape a while loop.
Post: RE: Having two inputs to escape a while loop.

I wouldn't use a list here. I would recommend removing the first line. In the third line, i would replace answer with 'yes'. Then in the fourth line, you could use .lower() to make all types of 'yes' ...
kotter Homework 4 2,645 Jun-10-2019, 05:47 PM
    Thread: Removing extra space
Post: RE: Removing extra space

This happens because in the print function you are using commas. This should fix it: print('Unit price: $' + str(uprice)) print('Total price: $' + str(tot))
kotter Homework 4 2,781 Jun-07-2019, 05:14 PM
    Thread: count unique letters in a word
Post: RE: count unique letters in a word

Maybe you understand this code better: # write function that counts number of unique english letters def unique_english_letters(word): var1 = [y for y in word if y.isalpha()] #list containing onl...
kotter Homework 4 8,642 Jun-06-2019, 07:15 PM

User Panel Messages

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