Skip to content

Instantly share code, notes, and snippets.

View Logic2apply's full-sized avatar

Logic2apply Logic2apply

  • India
View GitHub Profile
@Logic2apply
Logic2apply / automateWhatsapp.py
Created June 30, 2023 11:25
Send multiple messages from whatsapp web at one click.
import pyautogui
import webbrowser as wb
import time
import hashlib
usrInp = int(input("\nSend Messages to:\n\t1. Chat\n\t2. Group\n: "))
if usrInp == 1:
countryCode = str(input("\nEnter Country Code:\n: "))
phoneNo = int(input("\nEnter Phone Number:\n: "))
phone = f"{countryCode}{phoneNo}"
@Logic2apply
Logic2apply / Readme.md
Last active November 19, 2021 07:44
You are given few sentences as a list (Python list of sentences). Take a query string as an input from the user. You have to pull out the sentences matching this query inputted by the user in decreasing order of relevance after converting every word in the query and the sentence to lowercase. Most relevant sentence is the one with the maximum nu…

Search The Sentence

You are given few sentences as a list (Python list of sentences). Take a query string as an input from the user. You have to pull out the sentences matching this query inputted by the user in decreasing order of relevance after converting every word in the query and the sentence to lowercase. Most relevant sentence is the one with the maximum number of matching words with the query. Sentences = [“This is good”, “python is good”, “python is not python snake”]

Input:

Please input your query string: "Python is"

Output:

3 results found:

  1. python is not python snake
import random
class player:
def __init__(self, name, inital, final):
self.name = name
self.initial = inital
self.final = final
self.trials = 0
self.generated_number = random.randint(self.initial, self.final)
def checkCorrection(self, enteredNum):
@Logic2apply
Logic2apply / PalindromifyList.py
Created November 18, 2021 11:16
Palindromify List. You are given a list that contains some numbers. You have to print a list of the next palindromes only if the number is greater than 10; otherwise, you will print that number.
def nextPalindrom(n):
next = n
while not is_Palindrom(next):
next += 1
return next
def is_Palindrom(n):
return str(n) == str(n)[::-1]
if __name__ == "__main__":
@Logic2apply
Logic2apply / Readme.md
Created November 17, 2021 15:11
The Next Palindrome. A palindrome is a string that, when reversed, is equal to itself. Example of the palindrome includes: 676, 616, mom, 100001.

The Next Palindrom

A palindrome is a string that, when reversed, is equal to itself. Example of the palindrome includes:

  • 1001
  • 333
  • mom
  • dad, etc.

You have to take a number as an input from the user. You have to find the next palindrome corresponding to that number. Your first input should be the number of test cases and then take all the cases as input from the user.

Input

@Logic2apply
Logic2apply / Automate-Whatsapp.py
Last active June 18, 2021 12:11
Send Bulk messages on Whatsapp using Python.
import pyautogui
import webbrowser as wb
import time
usrInp = int(input("\nSend Messages to:\n\t1. Chat\n\t2. Group\n: "))
if usrInp == 1:
countryCode = str(input("\nEnter Country Code:\n: "))
phoneNo = int(input("\nEnter Phone Number:\n: "))
phone = f"{countryCode}{phoneNo}"
@Logic2apply
Logic2apply / Food-and-Calories-Reverse-the-List.py
Created May 2, 2021 09:24
You visited a restaurant called EXAMPLE, and the food items in that restaurant are sorted, based on their amount of calories. You have to reserve this list of food items containing calories.
# Food and Calories
listinp = input("\nYour calorie list:\n: ")
listinp = listinp.split(",")
# Inbuilt Method
revlist1 = listinp.copy()
revlist1.reverse()
print(f"\nUsing Inbuilt method of Python {revlist1}\n")
# Using List slicing
@Logic2apply
Logic2apply / Divide-the-Apple.py
Last active May 2, 2021 09:27
Divide the Apples - Factor Generator
# Divide the Apples
try:
n = int(input("\nEnter the number of apples you got\n: "))
mn = int(input("\nEnter the Minimim number\n: "))
mx = int(input("\nEnter the Maximum number\n: "))
except Exception as e:
print("Invalid input! Only integer allowded")
exit()
@Logic2apply
Logic2apply / Age-Calculator.py
Last active May 2, 2021 09:28
Your Age in 2090 - Age Calculator
# Your age in 2090
today = 2021
hundfromToday = today + 100
def age(userAge):
userAge = int(userAge)
if userAge<1:
print("\nYou are not born yet!!\n")
elif userAge>100: