This file contains hidden or 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
#reusing code written before | |
countries=country | |
best_choc={} # empty dictionary | |
for j in countries: | |
c=0 | |
b=df[df['location']==j] | |
br=b[b['rating']>=4] # rating more than 4 | |
for i in br['rating']: | |
c+=1 | |
best_choc[j]=c |
This file contains hidden or 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
#to get the indices | |
countries=df['broad_bean_orig'].value_counts().index.tolist()[:5] | |
# countries has the top 5 countries in terms of reviews | |
best_choc={} # empty dictionary | |
for j in countries: | |
c=0 | |
b=df[df['broad_bean_orig']==j] | |
br=b[b['rating']>=3] # rating more than 3 | |
for i in br['rating']: | |
c+=1 |
This file contains hidden or 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
print('Bank Management System') | |
b=[] | |
c='y' | |
while(c=='y'): | |
name=input('Enter customer name: ') | |
accno=str(input('Enter the account number: ')) | |
amount=int(input('Enter the amount you have: ')) | |
b.append((accno,(name,amount))) | |
c=input('do u want to enter details? ') | |
bank=dict(b) |
This file contains hidden or 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
#include <iostream.h> | |
int main() | |
{ | |
cout<<"\t\t\t\t"<<"GAUSS ELIMINATION"<<endl; | |
int x,y,z; | |
int a1,b1,c1,a2,b2,c2,a3,b3,c3,d1,d2,d3; | |
cout<<"Enter the coeeficients of x,y,z in the same order for equation 1.Also enter the constant on RHS after that."<<endl; | |
cin>>a1>>b1>>c1>>d1; | |
cout<<"Enter the coeeficients of x,y,z in the same order for equation 2.Also enter the constant on RHS after that."<<endl; |
This file contains hidden or 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 random | |
n=random.randint(1,100) | |
pts=100 | |
c=1 | |
i=1 | |
print("Hello Player! Welcome to the Number Guess Game!\n U get like 10 chances to guess a number that the computer generates...\n You have clues but only at try 1,try 4 and try 7. \n WARNING: YOU LOSE POINTS FOR EACH CLUE!") | |
while(i<=10): | |
a=int(input("\nEnter number between 1 and 100: ")) | |
if(a==n): | |
print("\nYou win!") |
This file contains hidden or 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
x='X' | |
o='O' | |
EMPTY=' ' | |
NUM_SQUARES=9 | |
played_moves=[] | |
board=[] | |
c=0 | |
def instructions(): | |
print("Tic tac toe game.\nPlayer 1 is always the first to move and he gets 'X' by default") | |
print('The game board is: \n') |