Search Results
|
Post |
Author |
Forum |
Replies |
Views |
Posted
[asc]
|
|
|
Thread: Generating accounting transactions data
Post: Generating accounting transactions data
I was attempting to generate accounting transactions data for three years. I tried to use Faker but I got stuck at line 68:
"Date": fake.date_between(start_date=datetime.date(f'{year}-{month}-1'), end... |
|
Emekadavid |
General Coding Help |
0 |
431 |
Sep-22-2023, 09:00 AM |
|
|
Thread: multiple number format conversion
Post: RE: multiple number format conversion
In case you need to know, the numpy function has limits. It can only convert between bases 2-36. I checked it out. But one liners are good and beautiful. |
|
Emekadavid |
General Coding Help |
4 |
2,613 |
Aug-10-2020, 11:02 AM |
|
|
Thread: Can someone help me optimize this game for large number of strings
Post: RE: Can someone help me optimize this game for lar...
(Jun-27-2020, 11:13 PM)deanhystad Wrote: In your program a letter is either a vowel or it isn't (no confusion about Y) you certainly don't have to test twice.
Why are you making a substring? You k... |
|
Emekadavid |
Homework |
13 |
5,001 |
Jun-28-2020, 07:37 PM |
|
|
Thread: Can someone help me optimize this game for large number of strings
Post: RE: Can someone help me optimize this game for lar...
(Jun-27-2020, 07:56 PM)GOTO10 Wrote: From your test case using "BANANA", you know that Stuart's score (count of substrings beginning with a consonant) is 12. Note that there are 6 substrings that b... |
|
Emekadavid |
Homework |
13 |
5,001 |
Jun-27-2020, 08:43 PM |
|
|
Thread: Can someone help me optimize this game for large number of strings
Post: RE: Can someone help me optimize this game for lar...
(Jun-27-2020, 04:25 PM)deanhystad Wrote: This is a really expensive way to do very simple math
for j in range(i, len(text)):
countConsonants += 1 This is a logic probl... |
|
Emekadavid |
Homework |
13 |
5,001 |
Jun-27-2020, 06:58 PM |
|
|
Thread: Can someone help me optimize this game for large number of strings
Post: RE: Can someone help me optimize this game for lar...
I don't think it is a logic problem. I have modeled that loop several ways. The loop is counting substrings in string that is why it was designed that way. If you can help me I would be grateful. I ha... |
|
Emekadavid |
Homework |
13 |
5,001 |
Jun-27-2020, 05:25 PM |
|
|
Thread: Can someone help me optimize this game for large number of strings
Post: RE: Can someone help me optimize this game for lar...
I will try out counting directly and see how it goes. Thanks for the idea.
(Jun-26-2020, 05:54 PM)GOTO10 Wrote: I can think of one other hint to share, but it might make the solution too obvious. ... |
|
Emekadavid |
Homework |
13 |
5,001 |
Jun-26-2020, 06:15 PM |
|
|
Thread: Please, how do I call the method inside this class
Post: Please, how do I call the method inside this class
I understand about methods and variables in classes but I was reading this book on data structures and understand what the author was saying until he wrote a utility function inside a class, a progres... |
|
Emekadavid |
Homework |
1 |
1,684 |
Jun-26-2020, 12:58 PM |
|
|
Thread: Tools for black box and glass box (white box) testing
Post: RE: Tools for black box and glass box (white box) ...
Thanks everyone. Now I have to start doing the tests. I think I have something to start with. |
|
Emekadavid |
News and Discussions |
3 |
55,402 |
Jun-25-2020, 03:29 PM |
|
|
Thread: Can someone help me optimize this game for large number of strings
Post: Can someone help me optimize this game for large n...
I was given an assignment to create a game that takes a string as input and then evaluate the substrings starting with a consonant and the substrings starting with a vowel and print out which side, th... |
|
Emekadavid |
Homework |
13 |
5,001 |
Jun-25-2020, 11:30 AM |
|
|
Thread: Tools for black box and glass box (white box) testing
Post: Tools for black box and glass box (white box) test...
Please can someone recommend a tool for black box testing and white box (or glass box) testing. I need to do testing on some code and need them.or maybe unit and regression tests for python code.
Than... |
|
Emekadavid |
News and Discussions |
3 |
55,402 |
Jun-25-2020, 07:21 AM |
|
|
Thread: Problem with regex
Post: Problem with regex
I want to take:
s = '1 w 2 r 3g'And format it to:
s = '1 W 2 R 3g'Based on the concept that the first letter after any space is converted to upper including the first letter.
I tried: s.title() but... |
|
Emekadavid |
Homework |
1 |
1,580 |
Jun-22-2020, 10:52 PM |
|
|
Thread: Constraints in for loop
Post: Constraints in for loop
I am doing a challenge in hackerrank and was given this stub code:
for _ in range(int(input))
name = input()
score = float(input())The constraints code to add is that make sure the loop goes ... |
|
Emekadavid |
Homework |
2 |
1,916 |
Jun-13-2020, 06:23 AM |
|
|
Thread: Which database should I learn
Post: RE: Which database should I learn
I have already downloaded mysql after the previous post. I will look into it and add it to one of my programmer skills. I hope it does not have a steep learning curve? |
|
Emekadavid |
News and Discussions |
5 |
2,466 |
Jun-11-2020, 03:32 PM |
|
|
Thread: Is this code pythonic
Post: RE: Is this code pythonic
Your implementation was wonderful. Now I have learned new tricks. I will go an read up on assert expression. I have not encountered assert in my readings.
Thanks |
|
Emekadavid |
Homework |
2 |
2,007 |
Jun-10-2020, 03:41 PM |
|
|
Thread: Is this code pythonic
Post: Is this code pythonic
As a beginner, I aim to write pythonic code because that would get me motivated into doing python the pythonic way. I was doing this challenge on 2d lists (or arrays) from hackerrank, and got the answ... |
|
Emekadavid |
Homework |
2 |
2,007 |
Jun-10-2020, 02:42 PM |
|
|
Thread: Why is one duplicate not removed?
Post: RE: Why is one duplicate not removed?
Ok. Iterate over the copy and then remove the duplicate in the original list. Got it. I changed the code to:
for i in L1[:]:and it worked. Thanks. solved. |
|
Emekadavid |
General Coding Help |
4 |
2,386 |
Jun-09-2020, 02:35 PM |
|
|
Thread: question about for loop
Post: RE: question about for loop
As you can go forwards, you can also go backwards. That makes your programming flexible and convenient. Here is a code that moves through the above number line backwards. Just make the stop a negative... |
|
Emekadavid |
General Coding Help |
5 |
2,524 |
Jun-09-2020, 02:16 PM |
|
|
Thread: Why is one duplicate not removed?
Post: Why is one duplicate not removed?
This code removes the duplicates in two lists. But when I run it, one of the duplicates is not removed. It beats me. Can someone explain to me why.
def removeDups(L1, L2):
"""Assumes that L1 and... |
|
Emekadavid |
General Coding Help |
4 |
2,386 |
Jun-09-2020, 02:11 PM |
|
|
Thread: Question about my code
Post: RE: Question about my code
In fact you have to understand range as a reference to the number line.
If you try:
dlist = list(range(-1, 3)
print(dlist)The output will show you that range is just moving along the number line. I... |
|
Emekadavid |
Homework |
5 |
2,672 |
Jun-08-2020, 06:28 PM |