AK Python
1.86K subscribers
39 photos
2 videos
11 files
236 links
Join here to unlock your programming ability
Download Telegram
‼️code for previous video { Student mark prediction project } [ Like share comment and subscribe❤️
import pickle
var = input("Please enter the news text you want to verify: ")
print("You entered: " + str(var))


# function to run for prediction
def fakenews(var):
# retrieving the best model for prediction call
load_model = pickle.load(open('A:\data\model.sav', 'rb'))
prediction = load_model.predict([var])
prob = load_model.predict_proba([var])

return (print("The given statement is ",prediction[0]),
print("The truth probability score is ",prob[0][1]))


if name == 'main':
fakenews(var)
🤔3
Here is the code for Fake news predictor Using python [ Keep share & support for more updates❤️]
⚠️Kindly follow our Instagram account [ akpythonyt ] for interactions and more programming updates😊
[ subscribe & stay tuned ]
from colorthief import ColorThief

colorthief=ColorThief("Path of your image")

dominatcolor=colorthief.get_color(quality=1)
print(dominatcolor)

palette=colorthief.get_palette(color_count=6)
print(palette)
code for Color prediction👆
import PySimpleGUI as sg
import psutil
sg.theme('DarkAmber')

layout = [[sg.Text('CPU Meter')],
[sg.Text(size=(15,4 ), font=('Helvetica', 20),
justification='center', key='-text-')],
[sg.Exit(button_color=('white', 'firebrick4'),size=(9, 1))]]
window = sg.Window('AK CPU widget',
layout,
no_titlebar=False,
grab_anywhere=True, finalize=True)
interval = 10
while True:
event, values = window.read(timeout=interval)
if event in (sg.WIN_CLOSED, 'Exit'):
break
cpu_percent = psutil.cpu_percent(interval=1)
window['-text-'].update(f'CPU {cpu_percent:02.0f}%')
window.close()
⚠️code for CPU meter widget using python [ subscribe and support ]
This media is not supported in your browser
VIEW IN TELEGRAM
Today 8:00 PM [ Subscribe & share ]😊
⚠️Code for this Video: def knapsack(Capacity, weights, profits, n):
if(n==0 or Capacity==0):
return 0
if(weights[n-1]>Capacity):
return knapsack(Capacity, weights, profits, n-1)
else:
return max(profits[n-1]+knapsack(Capacity-weights[n-1], weights, profits, n-1), knapsack(Capacity,weights, profits, n-1))
print('Enter the profits:')
profits=list(map(int,input().split(' ')))
print('Enter the weights:')
weights=list(map(int,input().split(' ')))
Capacity=int(input('Enter the maximum capacity:'))
n=len(weights)
print(knapsack(Capacity, weights, profits, n))
Check out the latest video❤️
This media is not supported in your browser
VIEW IN TELEGRAM
Next video: How to create a fidget spinner using python [ Share & Support ❤️ ]
Guys check the video is out now..!