Skip to content

Instantly share code, notes, and snippets.

View vijayakumarchinthala's full-sized avatar
🏠
Working from home

chinthala vijaya kumar vijayakumarchinthala

🏠
Working from home
  • Nellore
View GitHub Profile
#Question 1:
a=int(input("Enter the number"))
if a>0:
print("Positive number")
elif a<0:
print("Negative Number")
else:
print("Zero")
#output
#The variables ph1 to ph10 represents 10 different real-time phishing emails.
from collections import Counter
ph1= ["Robocalls are on the rise. Be wary of any pre-recorded messages you might receive"]
ph2=["our access to your library account is expiring soon due to inactivity. To continue to have access to the library services account, you must reactivate your account. For this purpose, click the web address below or copy and paste it into your web browser. A successful login will activate your account and you will be redirected to your library profile"]
ph3=["We detected unknown IP access on our date base computer system our security requires you to verify your account for secure security kindly Click Here and verify your account"]
ph4=["Password will expire in 2 days Click Here To Validate E-mail account"]
@vijayakumarchinthala
vijayakumarchinthala / class 11.py
Last active November 9, 2021 04:08
Class 11 Python lab computer Science(083)
5a)
x=int(input("Enter base value"))
n=int(input("Enter Power value"))
print("x pow of n ->",x**n)
Output:
Enter base value2
Enter Power value3
x pow of n -> 8
-------------------------------------------------------------------------------------------------------------
@vijayakumarchinthala
vijayakumarchinthala / 15.py
Created February 9, 2021 11:16
Arithmetic Operations in Python using tkinter GUI
from tkinter import *
class MyWindow:
def __init__(self, win):
self.lbl1=Label(win, text='First number')
self.lbl2=Label(win, text='Second number')
self.lbl3=Label(win, text='Result')
self.t1=Entry(bd=3)
self.t2=Entry()
self.t3=Entry()
self.btn1 = Button(win, text='Add')
@vijayakumarchinthala
vijayakumarchinthala / mysql4.txt
Last active January 29, 2021 09:44
Modify column definitions a)Data Type b)Size c)Default Value d) NOT NULL column constraint e) Order of column
a)Alter table- Add column
mysql> select *from student3;
+--------+----------+-------+-------+
| rollno | Name | CLASS | MARKS |
+--------+----------+-------+-------+
| 101 | student1 | 12 | 90 |
| 102 | student2 | 12 | 89 |
| 103 | student3 | 12 | 88 |
| 104 | student4 | 12 | 87 |
@vijayakumarchinthala
vijayakumarchinthala / p18.py
Created January 27, 2021 07:37
Program 18:Integrate SQL with Python by importing the pymysql module
import pymysql as pym
mycon=sqltor.connect(host="localhost",user="root",passwd="tiger",database="gvkcv")
cursor=mycon.cursor()
cursor.execute("select *from student10")
data=cursor.fetchall()
for i in data:
print(i)
mycon.close()
@vijayakumarchinthala
vijayakumarchinthala / p17.py
Last active January 27, 2021 07:36
mysql with python
import mysql.connector as sqltor
mycon=sqltor.connect(host="localhost",user="root",passwd="tiger",database="gvkcv")
if mycon.is_connected()==False:
print("error connecting to database")
cursor=mycon.cursor()
cursor.execute("select *from student10")
data=cursor.fetchall()
for i in data:
print(i)
mycon.close()
@vijayakumarchinthala
vijayakumarchinthala / PROGRAM 16.txt
Created January 15, 2021 12:52
Program 16 Create a student table and insert data. Implement the following SQL commands on the student table: ALTER table to add new attributes / modify data type / drop attribute UPDATE table to modify data ORDER By to display data in ascending / descending order DELETE to remove tuple(s) GROUP BY and find the min, max, sum, count and average
#Switched to a database
mysql> USE GVKCV;
Database changed
#Creating table student
mysql> create table student
-> (ROLLNO INT NOT NULL PRIMARY KEY,
-> NAME CHAR(10),
-> TELUGU CHAR(10),
-> HINDI CHAR(10),
@vijayakumarchinthala
vijayakumarchinthala / mysql3.txt
Created January 12, 2021 09:38
14.Inserting data from another table.
mysql> create table student4
-> (rollno int not null primary key,
-> name char(10) not null,
-> class int);
Query OK, 0 rows affected (0.49 sec)
mysql> insert into student4
-> select rollno,name,class from student3;
Query OK, 4 rows affected (0.17 sec)
Records: 4 Duplicates: 0 Warnings: 0
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.