All Questions
49 questions
-7
votes
0
answers
55
views
Why is my create_spend_chart output not matching the required format? [closed]
I’m trying to solve a project where I build a Category class and a create_spend_chart function to create a text-based spend chart.
My Category class methods (deposit, withdraw, transfer) seem to work ...
0
votes
1
answer
42
views
Unable to display statistics viewing for my python project
I have a Python project from an online course whereby I am tasked to build an interactive learning tool that allows users to create, practice, and test their knowledge using multiple-choice and ...
1
vote
2
answers
46
views
Tracking Python code execution by printing accessed functions
I have an extensive Python project with many files. With the aim of debugging, I want to be able to run my program and have the names of the executed functions printed to the terminal. Is there a ...
1
vote
1
answer
64
views
Python: trace all previous call stack of a library for debug purpose
Is there any elegant and easy way to trace all the call stacks in Python of a library for debugging or code understanding purposes?
Suppose there is a very big huge library that I'm importing and need ...
0
votes
1
answer
119
views
I cannot step into the imported function from the Python module using the PyCharm debugger
I have my main Python script that uses the function 'hello_world' from my imported module 'module1.py
However, if I use the PyCharm Debugger I cannot step into the 'hello_world' function.
I am ...
0
votes
1
answer
65
views
Function stacking, nesting, order of handling
Old dawg, coding experience goes way back, to the age of GoTo statements (Especially in automation scripts.) Python is Structured and (choke) "old habits" are nul. So.... An exercise to ...
0
votes
1
answer
57
views
Issue with Implementing a Recursive Function in Python to Calculate Factorials
I am trying to implement a recursive function in Python to calculate factorials, but I am facing some issues with the code. When I input a positive integer, the function is not returning the correct ...
-2
votes
2
answers
123
views
what is reason of this error? I am using Filter function to filter the odd numbers from the list
I am getting this error I am using filter function to filter the odd values from list
Code:
l1=[1,2,4,5,6,79,100,200,500]
finnal_list=list(filter(lambda x: (x%2!=0),l1))
print(finnal_list)
l1=[1,2,4,...
0
votes
0
answers
44
views
working on debugging for a class can someone tell me why this discount calculator is not working?
def calcDiscountPrice(price, percentage):
discount = price * percentage
discountPrice = price - discount
return discount
I am expecting the code to take the price and have it print the ...
0
votes
1
answer
3k
views
VS Code - Python Debugging - Step into internal functions
In VS Code, the step-by-step debugger won't step into internal functions, and instead, after the function is called it immediately assign the return value. how should I change my configuration in ...
0
votes
2
answers
93
views
Python finally block not catching errors
Take a look at a chunk of code:
move = [None, 20, 5, True, "a"]
valnum = 0
for val in move:
try:
if val >= 15:
val -= 3
move[...
0
votes
1
answer
212
views
Local variable referenced before assignment (but is it a bug?)
I'm trying to write an encryption function which works on bits, summing them up to get a new combination a bits, so i have this code:
a=list("100010")
b=list("1100011")
n=[]
tmp=b[...
0
votes
0
answers
408
views
Run Python code line by line to debug function inside a class
Normally, to debug a function outside a class I will assign all of its parameters then run & check the function code line by line. (Yes, I know this might not be a professional way!). However, for ...
-1
votes
1
answer
63
views
Where does the problem or bug lie in the logic of this while loop Machine Learning Cubic Root-Finding algorithmic code that calls a function?
Goal: The goal of this program is to find additional accelerators to the convergence process of cubic or n-polynomial root finding methods/algorithms.
Problem: The code can not tabulate one variable ...
0
votes
2
answers
58
views
Having trouble iterating over different conditions
I am having trouble with a function I'm trying to debug. The goal is to be able to read a text file and give the counts of e's where the output of count_letter_e() is TT TF FT FF with the following ...