This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
p = input("enter digit") | |
a = {"1": "one", "2": "two", "3": "three"} # example no you can change it by your self | |
out = "" | |
for ch in p: | |
out += a.get(ch, "!") + " " | |
print(out) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def GAME(): | |
i = 0 | |
started = False | |
st = False | |
while i < 10: | |
a = input('>') | |
if a == 'HELP' or a == 'help': | |
print("START:- Start the car \n STOP :- Stop the car \n END :- To end the race") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
i = 0 | |
while i <= 2: | |
p = int(input("guess your no from 0-9 : ")) | |
i += 1 | |
if p == 7: | |
{ | |
print("YOU WIN BUDDY 😎😎😎😎") | |
} | |
break |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
weight=input("enter your weight in pound") | |
conversion = int(weight)*0.45 | |
print("weight in kg"+str(conversion)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a=input("type of day") | |
if a == ' HOT' or a == ' hot': | |
print("its hot day \n Drink plenty of water") | |
elif a == ' COLD' or a == ' cold': | |
print("its cold \n wear warm clothes") | |
else: | |
print("its lovely day") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def emotes(): | |
p = input(">") | |
q = p.split(" ") | |
a = {"(:": " ☺ ", ":)": " 😞 ", "~": " 😡 "}# here emoji and emoticon can be added according to user | |
out = "" | |
for ch in q: | |
out += a.get(ch, ch) + " " | |
print(out) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a = [1, 2, 3, 4, 7, 7, 4] | |
b = [] | |
for i in a: | |
if i not in b: | |
b.append(i) | |
print(b) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class cal(): | |
def __init__(self,a,b): | |
self.a=a | |
self.b=b | |
def add(self): | |
return self.a+self.b | |
def mul(self): | |
return self.a*self.b | |
def div(self): | |
return self.a/self.b |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class dice: | |
def rol(self, l): | |
print(random.choice(l)) | |
p = ((1, 1), (1, 2), (1, 3), (1, 4), (1, 5), (1, 6), | |
(2, 1), (2, 2), (2, 3), (2, 4), (2, 5), (2, 6), | |
(3, 1), (3, 2), (3, 3), (3, 4), (3, 5), (3, 6), | |
(4, 1), (4, 2), (4, 3), (4, 4), (4, 5), (4, 6), | |
(5, 1), (5, 2), (5, 3), (5, 4), (5, 5), (5, 6), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import openpyxl as x | |
from openpyxl.chart import Reference, BarChart, BarChart3D | |
i = 0 | |
wb = x.load_workbook("transactions.xlsx") | |
sheet = wb['Sheet1'] | |
# cell = sheet['a1'] | |
cell = sheet.cell(1, 1) | |
#print(cell) | |
z = sheet.max_row | |
for k in range(2, z+1): |
OlderNewer