In [6]:
print('Hello world')
Hello world
In [7]:
print('welcome','to','python', sep='-')
welcome-to-python
In [8]:
print('Welcome '+ 'to '+'python')
Welcome to python
In [9]:
print('Welcome '+ 'to '+'python') # adding string 
Welcome to python
In [2]:
id = 5
name = " Great Raju"
mark =45
#print(type(name))
name = 56
print("ID={:03}".format(id))
ID=005
In [3]:
print(id)
print(name)
5
56

Removing line break at the end

In [4]:
print(id,end='')
print(name)
556

Adding format to Integer

In [ ]:
print("ID={:03}".format(id))
ID=005
In [5]:
id=4
print("ID={:.2f}".format(id))
ID=4.00
In [ ]:
for i in range(4):
  print(i,end='')
  print('hi')
print(" I am at end , outside the loop")
0hi
1hi
2hi
3hi
 I am at end , outside the loop
In [ ]:
#printing a list , tuple 
my_list=['One','Two','Three'] # A list 
print(my_list) # ['One', 'Two', 'Three']
['One', 'Two', 'Three']
In [ ]:
#printing a list , tuple 
my_list=('One','Two','Three') # A tuple 
print(my_list) # ('One', 'Two', 'Three')
('One', 'Two', 'Three')