def func(message, num = 1): print(message * num) func('Welcome') func('Viewers', 3) ------------------------------------------------------ x=50 def fun(): global x print(x) x = 2 print(x) fun() #function calling print(x) ------------------------------------------------------- def power(x,y=2): r=1 for i in range(y): r=r*x return r print(power(3)) print(power(3,3)) -------------------------------------------------------- def info(name, age=50): print ("Name", name) print ("age", age ) info("mohit", age=28) info("Ravi") info(56) ------------------------------------------------- def Jumpto(N1,N2 = 20): N1=N1+N2; print(N1,N2) #main function First=10 Second=20 Jumpto(First,Second) Jumpto(Second) ---------------------------------------------------- def Location(X,Y=4): Y+=2 X+=Y return Y #main function PX=10 PY=2 print(Location(PY)) print(PX,",",PY) Location(PX,PY) print(PX,",",PY) ------------------------------------------------ def s(a, b=7): a+=2 b*=5 print(a,":",b) a,b=4,8 print(a,":",b) s(a,b) print(a,":",b) s(a) print(a,":",b) ------------------------------------------------ def show(s): l=s.split('a') for i in l: if len(i)>5: print(i," : ",len(i)) s="I LoVe My INdiA" show(s) -------------------------------------------- def show(s): r="" size=len(s) for i in range(size): if i%2==0: r+=s[i].upper() else: r+=s[i] return r s="Ali Baba . com 2002" print(show(s)) ---------------------------------------------- def SwitchOver(A,N,split): for K in range(N): if(K>> L1=[1,2,3] >>> L1[3] ------------------------------------------------- >>> D1={'1':"aa", '2':"bb", '3':"cc"} >>> D1['4'] -------------------------------------------------- '2'+2 ----------------------------------------------- int('xyz') ------------------------------------- >>> fro i in range(10): --------------------------------------- X,y="Mohan","Rahul" name=INPUT("Enter Name of EMP: ") if x==name; print(x," Sal 12000/-") else if y = "Rahul": print(y," Sal 15000/- ' ) else PRINT("Name Not Match") ---------------------------------------------------- x,y=14, length('Board Exam2020 ") if x < y: st= "x is less than y" el if(x>y): st= "x is greater than y" else if : st= "x is = Y" print (St) ------------------------------------------ a=integer(input("Enter Any Number")) S,c=0,0 while(a!=0): N=a%10 a=a//10 for i in range(2,n++1): if i%n==0: c=c+1 if c==1 s=s+n C=0 print(s)