Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

n=input("Enter a string")

upper=0
lower=0
special=0
number=0
for i in n:
if i>='65' and i<='90':
uper+=1
elif i>='97' and i<='122':
lower+=1
elif i>='48' and i<='57':
number+=1
else:
special+=1
print(upper)
print(lower)
print(special)

import random
class Dice:
def roll(self):
first=random.randint(1,6)
second=random.randint(1,6)
return first,second

m=int(input("Enter no of time want to roll a dice"))


r=Dice()
for i in range(m):
print(r.roll())
print("Done playing")

from pathlib import Path

p=Path()
y=p.glob('*.py')
for file in y:
print(file)

p=Path("h1")
print(p.exists())

p=Path("eccomerce")
print(p.mkdir())

p=Path("eccomerce")
print(p.rmdir())
O/P

app.py

functions.py

str.py

True

None
None
import openpyxl as xl
from openpyxl.chart import BarChart,Reference

wb=xl.load_workbook('transactions.xlsx')
sheet=wb['Sheet1']

for row in range(2,sheet.max_row+1):


cell=sheet.cell(row,3)
corrected_price=cell.value*0.9
corrected_price_cell=sheet.cell(row,4)
corrected_price_cell.value=corrected_price

values=Reference(sheet,
min_row=2,
max_row=sheet.max_row,
min_col=4,
max_col=4)
chart=BarChart()
chart.add_data(values)
sheet.add_chart(chart, "e2")

wb.save("trans1.xlsx")

You might also like