Hello user, This is a blog that provides you various coding ideas and projects in Python language.
Search This Blog
MY PROGRAMMES
-
►
2025
(2)
- ► March 2025 (1)
- ► February 2025 (1)
-
▼
2023
(91)
- ▼ December 2023 (8)
- ► November 2023 (2)
- ► September 2023 (4)
- ► August 2023 (4)
- ► April 2023 (65)
Saturday, December 30, 2023
SNAKE N LADDERS
Monday, December 18, 2023
ODD AND EVEN GAME
OUTPUT
Saturday, December 16, 2023
RANDOM DIGIT WELL
import random as ran
l=[0,0,0,0,0,0,0,0,0]
c=3
acl=[0,0,0,0,0,0,0,0,0]
o=0
c=0
while o!=3:
print("""Choose the operation to perform:
1. Clockwise
2. Anti Clockwise
3. Exit""")
o=int(input("Enter the operation number = "))
if o==3:
break
elif o==1:
c+=1
m=[0,0,0,0,0,0,0,0,0]
for i in range(2,-5,-1):
m[i]=l[i+1]
if l[5]!=0:
ac=[0,0,0,0,0,0,0,0,0]
for i in range(0,8):
ac[i+1]=acl[i]
for i in range(0,9):
acl[i]=ac[i]
acl[0]=l[5]
for i in range(0,9):
l[i]=m[i]
r=ran.randint(1,9)
l[3]=r
elif o==2:
m=[0,0,0,0,0,0,0,0,0]
for i in range(-5,3):
m[i+1]=l[i]
for i in range(0,9):
l[i]=m[i]
if acl[0]!=0:
l[5]=acl[0]
ac=[0,0,0,0,0,0,0,0,0]
for i in range(0,8):
ac[i]=acl[i+1]
for i in range(0,9):
acl[i]=ac[i]
s=0
for i in range(0,9):
if l[i]==0:
s+=1
if s==9:
print("WELL IS EMPTY")
print(l[2],'│',l[1],'│',l[0])
print('──┼───┼──')
print(l[3],'│',l[4],'│',l[8])
print('──┼───┼──')
print(l[5],'│',l[6],'│',l[7])
print(' │ │ ')
OUTPUT
Thursday, December 14, 2023
ELEDEX
e=int(input("Enter number of protons = "))
en=e
ep=e
csh=0
ece=['1s','2s','2p','3s','3p','4s','3d','4p','5s','4d','5p','6s','4d','5p','6s','4f','5d','6p','7s','5f','6d','7p']
s=0
c=0
m=0
eceo=[]
ecep=[]
eces=[]
gr=0
num=[0,'¹','²','³','⁴','⁵','⁶','⁷','⁸','⁹','¹⁰','¹¹','¹²','¹³','¹⁴']
sup=['¹⁴','¹³','¹²','¹¹','¹⁰','⁹','⁸','⁷','⁶','⁵','⁴','³','²','¹']
if e==24:
c=1
ecep.append('1s²,2s²,2p⁶,3s²,3p⁶,4s¹,3d⁵')
print(""" Electronic configuration(Shell wise) = 2,8,8,6
Electronic configuration(Subshell wise) = 1s²,2s²,2p⁶,3s²,3p⁶,4s¹,3d⁵
Electronic Configuration(Noble Gas Wise) = [Ar]4s¹,3d⁵
Atomic Number = 24
Number of Electrons = 24
Number of Protons = 24
Oxidation State = 1,2,3,4,5,6
Period = 4
group = 6""")
elif e==29:
c=1
ecep.append('1s²,2s²,2p⁶,3s²,3p⁶,4s¹,3d¹⁰')
print("""Electronic Configuration(Shell wise) = 2,8,8,8,3
Electronic Configuration(Subshell wise) = 1s²,2s²,2p⁶,3s²,3p⁶,4s¹,3d¹⁰
Electronic Configuration(Noble Gas Wise) = [Ar]4s¹,3d¹⁰
Position in period Table = Period-4,Group-11
Atomic Number = 29
Number of Electrons = 29
Number of Protons = 29
Oxidation State = 1,2,3
Period = 4
Group=11""")
if c!=1:
print("Electronic Configuration(Shell wise) = ",end="")
while en>0:
csh+=1
if csh==1:
en=en-2
if en>=0:
eces.append(2)
elif en<0:
eces.append(1)
else:
en=en-8
if en>=0:
eces.append(8)
elif en<0:
eces.append(8+en)
for i in range(0,len(eces)):
if i==len(eces)-1:
print(eces[i])
else:
print(eces[i],end=",")
print("Electronic Configuration(Subshell wise) = ",end="")
while e>0:
if ece[s][1]=='s':
e=e-2
if e>=0:
ecep.append(ece[s])
ecep.append(sup[-2])
elif e<0:
ecep.append(ece[s])
ecep.append(sup[-1])
s+=1
elif ece[s][1]=='p':
e=e-6
if e>=0:
ecep.append(ece[s])
ecep.append(sup[-6])
elif e<0:
ecep.append(ece[s])
ecep.append(sup[-(6-abs(e))])
s+=1
elif ece[s][1]=='d':
e=e-10
if e>=0:
ecep.append(ece[s])
ecep.append(sup[-10])
elif e<0:
ecep.append(ece[s])
ecep.append(sup[-(10-abs(e))])
s+=1
elif ece[s][1]=='f':
e=e-14
if e>=0:
ecep.append(ece[s])
ecep.append(sup[0])
elif e<0:
ecep.append(ece[s])
ecep.append(sup[-(14-abs(e))])
s+=1
for i in range(0,len(ecep)):
if i==len(ecep)-1:
print(ecep[i],end='')
elif i%2!=0:
print(ecep[i],sep='',end=',')
else:
print(ecep[i],end='')
if ecep[len(ecep)-2]=='s':
g=sup.index(ecep[len(ecep)-1])
print()
for i in range(0,len(ecep)):
m+=1
if 9>=ep>1:
if m==1:
print("Electronic Configuration(Noble gas wise) =",'[He]',end="")
if i>1:
print(ecep[i],end="")
elif 17>=ep>9:
if m==1:
print("Electronic Configuration(Noble gas wise) =",'[Ne]',end="")
if i>5:
print(ecep[i],end="")
elif 35>=ep>17:
if m==1:
print("Electronic Configuration(Noble gas wise) =",'[Ar]',end="")
if i>9:
print(ecep[i],end="")
elif 53>=ep>35:
if m==1:
print("Electronic Configuration(Noble gas wise) =",'[Kr]',end="")
if i>15:
print(ecep[i],end="")
elif 85>=ep>53:
if m==1:
print("Electronic Configuration(Noble gas wise) =",'[Xe]',end="")
if i>21:
print(ecep[i],end="")
elif 117>=ep>85:
if m==1:
print("Electronic Configuration(Noble gas wise) =",'[Rn]',end="")
if i>31:
print(ecep[i],end="")
elif 127>=ep>117:
if m==1:
print("Electronic Configuration(Noble gas wise) =",'[Og]',end="")
if i>39:
print(ecep[i],end="")
print()
print("Atomic Number =",ep)
print("Number of Electrons =",ep)
print("Number of Protons =",ep)
if len(eces)>3:
print("Oxidation = ",end="")
for i in range(1,eces[len(eces)-1]+1):
if i==eces[len(eces)-1]:
print(i,end="")
else:
print(i,end=",")
else:
if eces[len(eces)-1]<=4:
print("Oxidation State =",eces[len(eces)-1])
else:
print("Oxidation State =",8-eces[len(eces)-1])
for i in range(0,len(ecep)):
eceo.append(ecep[i])
grp=ecep[len(ecep)-3::1]
sr=[]
for i in range(0,len(ecep)):
if ecep[i][0].isdigit():
sr.append(ecep[i])
sr.sort()
print()
j=-1
for i in range(0,len(grp)):
for j in range(0,len(grp[i])):
if grp[i][j]=='s':
gr=num.index(grp[-1])
elif grp[i][j]=='p':
gr=num.index(grp[-1])+10+num.index(grp[-3])
elif grp[i][j]=='d':
gr=num.index(grp[-1])+num.index(grp[-3])
print("Group =",gr)
print("Period =",grp[1][0])