Skip to main content

Posts

PYTHON GAME for Three matching coupon code then First Prize

PYTHON GAME for Three matching coupon code then First Prize:- coupon = {'A1','A2','B1','B2','A3','G7','G8','A0'} choice1 = input("Enter First coupon code in A1,A2,B1,B2,A3,G7,G8,A0 any of one") choice2 = input("Enter Second coupon code in A1,A2,B1,B2,A3,G7,G8,A0 any of one") choice3 = input("Enter Third coupon code in A1,A2,B1,B2,A3,G7,G8,A0 any of one") i1=0 i2=0 i3=0 i=1 lst1 =[] for s in coupon:     print(s)     lst1.append(s)     for ls in lst1:       if choice1 ==lst1[0] or choice1 ==lst1[1] or choice1 ==lst1[2]:        i1=1           if choice2 ==lst1[0] or choice2 ==lst1[1] or choice2 ==lst1[2]:        i2=2           if choice3 ==lst1[0] or choice3 ==lst1[1] or choice3 ==lst1[2]:        i3=3     if i1==1 and i2==2 and i3==3:     print("First Prize") elif i1==1 and i2==2...

Diamond program in python,pyramid program in python

Diamond program in python,pyramid program in python. Half Diamond:- for i in range(1,4):     for k in range(3,i,-1):         print(' ',end='')     for j in range(0,2*i-1):         print("*",end='')     print() Full Diamond for i in range(1,4):     for k in range(3,i,-1):         print(' ',end='')     for j in range(0,2*i-1):         print("*",end='')     print() for i in range(1,3):     for k in range(0,i):         print(' ',end='')     for j in range(2*i-1,4):         print("*",end='')     print()

Create Calculator Code in Angular Js

Design File :- calc.html <!DOCTYPE html> <html> <head> <title></title> <script type="text/javascript" src="angular.min.js"></script> <script type="text/javascript" src="calc.js"></script> </head> <body> <div ng-app="myapp" ng-controller="myctrl"> <input type="text"  ng-model="txtresult" /> <br><br> <input type="button" ng value="1" ng-click="fun('1')" /> <input type="button" value="2" ng-click="fun('2')"  /> <input type="button" value="3" ng-click="fun('3')"  /> <input type="button" value="4" ng-click="fun('4')"  /> <br><br> <input type="button" ng value="5" ng-click="fun('5')...

ATM Program in Python using class and object

WAP to create ATM operation with the following operation:- 1)  Enter pin code and provide three attempt 2)  Manage Credit, Debit and Check Balance Operation 3)  Create a program using OOPS concept class Bank:     balance=5000     def login(self,pin):         if pin==1111:             return True         else:             return False     def credit(self,amt):         self.balance+=amt     def debit(self,amt):         self.balance-=amt     def display(self):         print("Current balance is "+str(self.balance)) obj = Bank() flag=False for i in range(1,4):        if obj.login(int(input("enter pin code"))):            flag=True            break if flag:   while Tru...

Create Custom Plugin In WordPress

 The custom plugin is the best way to implement plugin functionality by code. We can inherit all features of POST to create Custom Plugin <?php /* plugin name:  MOVIES Plugin description:-  ADD MOVIE */ function create_posttype() { register_post_type( 'news', // CPT Options array(   'labels' => array(    'name' => __( 'news' ),    'singular_name' => __( 'News' )   ),   'public' => true,   'has_archive' => false,   'rewrite' => array('slug' => 'news'),  ) ); } // Hooking up our function to theme setup add_action( 'init', 'create_posttype' ); ?> How to call the plugin on code:- <?php /*Template Name: News*/ get_header(); query_posts(array(    'post_type' => 'news' )); ?> <?php while (have_posts()) : the_post(); ?> <h2><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2> ...

Machine learning:- K-means

Why do we need Data Preprocessing? A real-world data generally contains noises, missing values, and maybe in an unusable format that cannot be directly used for machine learning models. Data preprocessing is required tasks for cleaning the data and making it suitable for a machine learning model which also increases the accuracy and efficiency of a machine learning model. It involves the below steps: Getting the dataset Importing libraries Importing datasets Finding Missing Data Encoding Categorical Data Splitting dataset into training and test set Feature scaling from sklearn.impute import SimpleImputer  import pandas as pd import numpy as np from sklearn.preprocessing import LabelEncoder,OneHotEncoder  from sklearn.preprocessing import StandardScaler from sklearn.compose import ColumnTransformer from sklearn.model_selection import train_test_split   from sklearn.preprocessing import StandardScaler data_set= pd.read_csv...

Python Program List

  WAP to convert temperature from c to f? c/5 = (f-32)/9 Solution:- c=int(input("enter temprature in celsius"))  # "25"  to 25 f=(9*c+160)/5 print(f) WAP to calculate the sum of date of birth in a single digit?  (10061988) Solution:- dob = int(input("enter date of birth in ddmmyyyy")) #10061998 y1 = dob%10  #8   % return rem and // floor div dob=dob//10  #1006199 y2 = dob%10   #9 dob=dob//10  ##100619 y3=dob%10     #9 dob=dob//10  ##10061 y4=dob%10     #1 dob = dob//10  #1006 y5 = dob%10    #6 dob = dob//10  #100 y6 = dob%10   #0 dob = dob//10  #10 y7 = dob%10   #0 y8 = dob//10   #1 s=  y1+y2+y3+y4+y5+y6+y7+y8 print(s) s1 = s%10 s2=  s//10 print(s1+s2) WAP to calculate the salary of an employee where basic, ta, da, comm, pf,noofleave will be entered by the users? Solution:- basic = int(input("E...