Temprature Converter-Python Code
unit = input(“Enter C/F : “)
temp = float( input(“Enter the Temprature : “))
if unit == “C”:
print(“Converted Fahrenheit is : “,(temp*9/5) + 32)
if unit == “F”:
print(“Converted Celsius is : “,(temp-32)*5/9)
unit = input(“Enter C/F : “)
temp = float( input(“Enter the Temprature : “))
if unit == “C”:
print(“Converted Fahrenheit is : “,(temp*9/5) + 32)
if unit == “F”:
print(“Converted Celsius is : “,(temp-32)*5/9)
Generating random number with restricted given number of times
import random
computer_Num = random.randint(1,100)
limit=5
while limit > 0:
guess = int (input(“Guess the Number :”))
limit-=1
if guess == computer_Num:
print(“Guess is “,guess,”Computer Number is “,computer_Num,”You Won”)
if guess != computer_Num:
print(“Guess is “,guess,”Computer Number is “,computer_Num,”Wrong guess”)
computer_Num = random.randint(1,100)
if limit == 0:
print(“Your limit is reached”)
Not getting proper output
import requests
from bs4 import BeautifulSoup
url=”https://www.moneycontrol.com/stocks/marketstats/nsehigh/index.php”
page=requests.get(url)
soup=BeautifulSoup(page.content,”html.parser”)
company = soup.find_all(“a”,class_=”ReuseTable_gld13__HzxFN undefined”)
#print(company)
for cmp in company:
print(cmp.prettify(), end=”\n\n”)
MAY I KNOW WHAT MISTAKE I DID HERE.
2.Once i installed how to check in terminal
3.Once a virtual env created, for next project again should i need to create another venv?
OOP/OOPs – Object Oriented Programming/s
DevOps – Development and Operation
HTML – Hyper-Text Markup Language
API – Application Programming Interface
IDE – Integrated Development Environment
WWW – World Wide Web
HTTP – Hyper-Text Transfer Protocol
HTTPS – Hyper-Text Transfer Protocol Secured
XML – extensible Markup Language
PY – Python
GUI – Graphical User Interface
APP – Application
UI/UX – User Interface / User experience
PHP – Hyper-Text Preprocessor (previously called as Personal Home Page)
TDL – Tally Defination Language
TCP – Tally Complaint Product
.NET – Network Enabled Technology
XLS – Excel Spreadsheet
XLSX – Excel Open XML Spreadsheet
CSV – Comma-Separated Value
PDF – Portable Document Format
JSON – Java Script Object Notation
JPG/JPEG – Join Photographic Experts Group
PNG – Portable Network Graphics
.SQL – Structured Query Language
RDBMS – Relational DataBase Management System
Structured Query Language
Relational Data-Base Management System
SQL is a Free Open Source Software
MySQL Client – front end MySQL Server – back end
Functions of SQL Client
2. Receiving input from client end and convert it as token and send to sql server
3. Getting the results from SQL server to user
Functions of SQL Server
SQL server consists 2 Major part
Receiving the request from client and return the response after processing
1.Management Layer
a.Decoding the data
b.Validating and parsing(analyzing) the data
c.Sending the catched queries to Storage Engine
2.Storage Engine
a.Managing Database,tables,indexes
b.sending the data to other shared SQL Server
Install SQL in Ubuntu
sudo apt-get install mysql-server
To make secure configure as below
sudo mysql_secure_installation
1.It used to removes Anonymous users
2.Allow the root only from the local host
3.Removing the test database
MySQL Configuration options
/etc/mysql is the MySQL configuration directory
To Start MySQL
sudo service mysql start
To Stop MySQL
sudo service mysql stop
To Restart MySQL
sudo service mysql restart
MySQL Clients
Normally we will use mysql in command line
But in linux we can access through following GUI
MySQL Work Bench
sudo apt-get install MySQL-workbench
MySQL Navigator
sudo apt-get install MySQL-navigator
EMMA
sudo apt-get install emma
PHP MYAdmin
sudo aptitude install phpmyadmin
MySQL Admin
sudo apt-get install MySQL-admin
Kinds of MySQL
1.GUI based Desktop based application
2.Web based application
3.Shell based application -(text-only based applications)
To connect the server with MySQL client
mysql -u root -p
To connect with a particular host , user name, database name
mysql - h
mysql -u
mysql -p
if not given the above host/username/password , it will take default local server/ uinux user name and without password for authentication.
to find more options about mysql
mysql -?
to disconnect the client with server
exit
from page 33 to 39 need to understand and read agan.
Service center database software – Desktop based
Draft
ABC Computer Service Center
#123, Greater Road, South Extension, Old Mahabalipuram Road, Chennai
Job Sheet No: Abc20250001 JS Date:28/01/2025
Customer Name: S.Ganesh Contact No.:9876543210
Email:sganesh123@gmail.com Job Recd by.xxxx
Address: R.Ganesh, No.10/46, Madhya Kailash, Job alloted to:Eng.0001 Rajiv gandhi road, OMR, chennai – 600 000.
Product Details :
Product: Laptop Model:Dell Inspiron G123 Color: black 1TB Hdd, 8GB Ram
Customer Remarks:
Laptop in not working condition. it was working very slow. battery need to change.
Remarks from Engineer:
1.Charges informed approx.rs.2800 for battery and service charges
2.System got ready and informed to customer
3.Total amount rs.3500 collected and laptop given. (job sheet needs to close)
Job Status:
1.*Pending for process 2.* Pending for customer approval 3.*Completed and informed to customer 4.*Completed and closed
Job Sheet Closed Date: 30/01/2025
Job Closed by:Eng.0001
Revenue Details
Spare actual cost Rs.2500 (to be enter at the time of job closing)
Spare Sale income Rs.2800
Service income:700
IN THIS, REQUIRED DATA ONLY ADD FOR JOB SHEET PRINT. CONSOLIDATED ENGINEER REVENUE DETAILS WILL BE ENABLED ONLY FOR ADMIN USER.
I import sqlite3
class Database:
def __init__(self,db):
self.con=sqlite3.connect(db)
self.cur=self.con.cursor()
sql=”””
CREATE TABLE IF NOT EXISTS Customer(
id Integer Primary key,
name text,
mobile text,
email text,
address text,
)
“””
#self.cur.execute (sql) (getting error while executing this line. if removed i have getting empty database output sheet)
self.con.commit()
O=Database(“Customer.db”)
In this code Customer db is getting generated but there is no data
<!DOCTYPE html>
<html>
<head>
<style>
html{
background-color: gray;
}
body{
width:400px;
height:400px;
margin:0 auto;
margin-top: 50px;
background-color: red;
}
.row{
width:50px;
height:50px;
float:left;
}
.color1{
width:50px;
height:50px;
background-color:white;
border-color: black;
border-right:none;
border-style:groove;
border-width: 1px;
float:left;
}
.color2{
width:50px;
height:50px;
background-color:red;
border-color: black;
border-right:none;
border-style:groove;
border-width: 1px;
float:left;
}
</style>
</head>
<body>
<div class=”row”>
<div class=”color1″></div>
<div class=”color2″></div>
<div class=”color1″></div>
<div class=”color2″></div>
<div class=”color1″></div>
<div class=”color2″></div>
<div class=”color1″></div>
<div class=”color2″></div>
</div>
<div class=”row”>
<div class=”color2″></div>
<div class=”color1″></div>
<div class=”color2″></div>
<div class=”color1″></div>
<div class=”color2″></div>
<div class=”color1″></div>
<div class=”color2″></div>
<div class=”color1″></div>
</div>
<div class=”row”>
<div class=”color1″></div>
<div class=”color2″></div>
<div class=”color1″></div>
<div class=”color2″></div>
<div class=”color1″></div>
<div class=”color2″></div>
<div class=”color1″></div>
<div class=”color2″></div>
</div>
<div class=”row”>
<div class=”color2″></div>
<div class=”color1″></div>
<div class=”color2″></div>
<div class=”color1″></div>
<div class=”color2″></div>
<div class=”color1″></div>
<div class=”color2″></div>
<div class=”color1″></div>
</div>
<div class=”row”>
<div class=”color1″></div>
<div class=”color2″></div>
<div class=”color1″></div>
<div class=”color2″></div>
<div class=”color1″></div>
<div class=”color2″></div>
<div class=”color1″></div>
<div class=”color2″></div>
</div>
<div class=”row”>
<div class=”color2″></div>
<div class=”color1″></div>
<div class=”color2″></div>
<div class=”color1″></div>
<div class=”color2″></div>
<div class=”color1″></div>
<div class=”color2″></div>
<div class=”color1″></div>
</div>
<div class=”row”>
<div class=”color1″></div>
<div class=”color2″></div>
<div class=”color1″></div>
<div class=”color2″></div>
<div class=”color1″></div>
<div class=”color2″></div>
<div class=”color1″></div>
<div class=”color2″></div>
</div>
<div class=”row”>
<div class=”color2″></div>
<div class=”color1″></div>
<div class=”color2″></div>
<div class=”color1″></div>
<div class=”color2″></div>
<div class=”color1″></div>
<div class=”color2″></div>
<div class=”color1″></div>
</div>
</body>
</html>