a=5
print(a)
breakpoint()
a="Welcome"
print(a)
After printing value of a as 5, our process will stop. It will prompt to enter value. We can enter c to further continue the program. We can quit from this point by entering q
5
--Return--
> <ipython-input-11-bf9737819636>(3)<module>()->None
-> breakpoint()
(Pdb) c
Welcome
x=13
if x >10:
print(x)
breakpoint() # stop execution
else:
print('Value is fine ')
Using inside class
class Animal():
#class attributes
species='carnivores'
#instance attributes
def __init__(self1,name1,age,weight):
self1.name= name1
breakpoint()
self1.age=age
self1.weight=weight
self1.height=5 #instance attribute
#instantiate the Animal class
tiger=Animal("Ronald",5,15) # tiger is an object of Animal class
breakpoint()
# access the instance attributes
print("{} is {} years old animal".format( tiger.name, tiger.age))
All Built in Functions in Python
chr() ord()
Author & Instructor at plus2net
I write and maintain practical tutorials on Python, PHP, SQL, JavaScript, HTML, jQuery, and web development at plus2net. The tutorials focus on clear explanations, working examples, and code that readers can test and adapt while learning.