0 votes
141 views
in Python Programming (SBLC) by (420 points)
edited
Create a Gross Salary Calculator using Python with Streamlit

1 Answer

0 votes
by (98.9k points)
selected by
 
Best answer

We will be getting started from :

what is Streamlit ?

Streamlit is an open source app framework in Python language. It helps us create web apps for data science and machine learning in a short time. It is compatible with major Python libraries such as scikit-learn, Keras, PyTorch, SymPy(latex), NumPy, pandas, Matplotlib etc.

We will be Creating an web app with the help of Streamlit which can calculate gross salary of Employee

First Import it's Library

import streamlit as st

After That to print our heading Employee Gross Salary Calculator

We will use

st.header("Employee Gross Salary Calculator")

To take input
we have to use

st.text_input

for text and

st.number_input

for number

st.write 

for output or print

Complete Code

#importing required libraries

import streamlit as st




st.write("Employee Gross Salary Calculator")

a = st.text_input("Enter Name of Employee :  ")

h= st.text_input("Enter Name of Company : ")

b= st.number_input("Enter Basic salary of Employee : ")

c = st.number_input(" Dearness allowance percentage : ")

d = st.number_input(" House Rent allowance percentage : ")

st.write("Gross salaray Reciept of  ",a)
st.write(" Base salary Offered By company : ",b)

e= int(b)*int(c)/int(100)

st.write("Dearness allowance offered by company : ",e)

f= int(b)*int(d)/int(100)
st.write("House Rent Allowance offerd by Company : ",f)

g=int(b)+int(e)+int(f)
st.write(" Gross Salary : ",g)

st.write(h) 

Related questions

0 votes
1 answer 130 views
0 votes
1 answer 151 views

Doubtly is an online community for engineering students, offering:

  • Free viva questions PDFs
  • Previous year question papers (PYQs)
  • Academic doubt solutions
  • Expert-guided solutions

Get the pro version for free by logging in!

5.7k questions

5.1k answers

108 comments

563 users

...