Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: format String in SQL statement.
Post: Assertion Error: Getting values from SQL statement...

I cannot seem to return the correctly formatted information. I have provided the assertions that are being checked to be more clear. The information requested is in the, but I cannot figure out how to...
Steven Homework 9 6,562 May-29-2017, 08:28 PM
    Thread: format String in SQL statement.
Post: format String in SQL statement. More problems.

I cannot seem to return the correctly formatted information. I have provided the assertions that are being checked to be more clear. The information requested is in the, but I cannot figure out how to...
Steven Homework 9 6,562 May-29-2017, 07:10 PM
    Thread: format String in SQL statement.
Post: RE: format String in SQL statement.

That worked. I now have it working using your suggestions. Here's the updated code so other people may be helped. query = 'select title, rental_rate, rental_date, return_date, rental_duration\    FRO...
Steven Homework 9 6,562 May-27-2017, 06:16 PM
    Thread: format String in SQL statement.
Post: RE: format String in SQL statement.

No it's a string I'm supposed to check for. I have not been told I shouldn't format my parameters in my queries, but it's fairly open. The point is to hack our python code that implements sql statemen...
Steven Homework 9 6,562 May-26-2017, 11:12 PM
    Thread: Set Comprehension
Post: RE: Set Comprehension

Thank you.
Steven Homework 3 3,709 May-26-2017, 03:12 PM
    Thread: Finding Number of Lowercase letters in a Set
Post: RE: Finding Number of Lowercase letters in a Set

Thanks, little late, but that's way better.
Steven Homework 6 5,041 May-26-2017, 03:11 PM
    Thread: format String in SQL statement.
Post: format String in SQL statement.

Hello everyone. I am having a problem formatting a string. That's what it boils down to. I am using a sglite3 database and looking for a date format in the database. I'll show the code here: def fi...
Steven Homework 9 6,562 May-26-2017, 03:44 AM
    Thread: Formating for __repr__
Post: RE: Formating for __repr__

I mostly have it now. Thought I would follow up for anyone else and to see how to align it all correctly. Here's the code: formatted = '{0!s:6s},{1!s:6s},{2!s:6s}'.format(mass, position, velocity)Inp...
Steven Homework 5 4,202 Apr-23-2017, 04:08 PM
    Thread: Formating for __repr__
Post: RE: Formating for __repr__

Maybe it would help if I give you the entire __repr__ function.  The data being passed as parameters is mass = 3, position = (0,6.37e+06,0), and velocity = (0,0,0) def __repr__(self):         #Represe...
Steven Homework 5 4,202 Apr-22-2017, 04:18 PM
    Thread: Formating for __repr__
Post: Formating for __repr__

I am banging my head against the wall. I have tried so many different format things to get this to work and cannot figure it out.  I am not so sharp at making strings look exactly like I want them to....
Steven Homework 5 4,202 Apr-22-2017, 05:08 AM
    Thread: Finding Number of Lowercase letters in a Set
Post: RE: Finding Number of Lowercase letters in a Set

Awesome, this is what I did. fewestLetters = '' removeLetters = 26 for i in group: iValue = len({x for x in i if x in ascii_uppercase}) if iValue <= removeLetters: ...
Steven Homework 6 5,041 Apr-15-2017, 03:28 AM
    Thread: Finding Number of Lowercase letters in a Set
Post: Finding Number of Lowercase letters in a Set

I have a set being passed to a function. Each element has a word in it with a mixture of upper and lower case characters. I need to find the one with the least uppercase letters and return it. I'm at ...
Steven Homework 6 5,041 Apr-14-2017, 04:43 AM
    Thread: Set Comprehension
Post: Set Comprehension

I have a text file that is going to be sent to my function. I simply need to send the words in the file back in a set. Not so difficult with a for loop. My for loop is like this: #the text file is se...
Steven Homework 3 3,709 Apr-13-2017, 09:18 PM
    Thread: Why does Python Print return None
Post: RE: Why does Python Print return None

Thank you!
Steven Homework 6 21,590 Mar-19-2017, 02:12 AM
    Thread: Why does Python Print return None
Post: RE: Why does Python Print return None

Well, I mean that if I type print(print("hello")) at the python command line, it literally returns hello and then on the next line, slightly indented, None.
Steven Homework 6 21,590 Mar-19-2017, 01:42 AM
    Thread: Why does Python Print return None
Post: Why does Python Print return None

Hey all. I'm studying for a final. Wondering why using  print(print('hello') return Hello NoneCan't wrap my head around it.  Thanks everyone. -Steven
Steven Homework 6 21,590 Mar-19-2017, 12:58 AM

User Panel Messages

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