Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python debugger

#preinstalled package
import pdb; pdb.set_trace()
Comment

debugging python

import ipdb; ipdb.set_trace()
Comment

debugging python

#you can get a visualization of your code at python tutor
#below there is a function that is suppossed to mutate a list
#and multiply it by 2
#using pythontutor.com copy the code below into python tutor, then follow steps
#step 1: click visualize execution
#step 2: hit next for each line of code and find the problem
#step 3: click on the line with the problem code to add a break point.
#step 4: hit next, or click the red line on the bar
#step 5: fix the code, comment and thank if this helps!

def mutate(a_list):
  b_list = []
  for item in a_list:
    new_item = item * 2
  b_list.append(new_item)
  print(b_list)

mutate([1,2,3,5,8,13])
Comment

PREVIOUS NEXT
Code Example
Python :: how to reboot a python script 
Python :: remove index from dataframe pandas 
Python :: how to use inverse trigonometric functions in python 
Python :: model checkpoint keras 
Python :: np.array to list 
Python :: pgcd python 
Python :: negative index in python list 
Python :: how to sum only the even values in python 
Python :: threading python 
Python :: python: measure time code 
Python :: pandas inplace 
Python :: read tsv with python 
Python :: pandas dataframe remove rows by column value 
Python :: get first row sqlalchemy 
Python :: numpy get variance of array 
Python :: get sum of a range from user input 
Python :: how to change avatar of a bot using discord.py 
Python :: Import A Model 
Python :: merge two dictionaries in a single expression 
Python :: how to reduce width of image in pygame 
Python :: regex findall 
Python :: pandas change dtype to timestamp 
Python :: distplot with plotly 
Python :: perimeter of circle 
Python :: python cheat sheet 
Python :: count decimal number python 
Python :: sqlite query in python 
Python :: converting int to binary python 
Python :: input and ouput array in python 
Python :: tkinter prevent window resize 
ADD CONTENT
Topic
Content
Source link
Name
1+8 =