This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javax.swing.*; | |
public class NumberGuessing { | |
public static void main(String[] args) { | |
int computeNumber = (int) (Math.random() * 100 + 1); | |
int userAnswer = 0; | |
int count = 1; | |
try { | |
while (userAnswer != computeNumber) { | |
String response = JOptionPane.showInputDialog(null, "Enter a guess between 1 and 100"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
class BankAccount { | |
int balance; | |
int prevTransaction; | |
String customerName; | |
String customerId; | |
int flag = 0; | |
BankAccount(String cName, String cId) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
roman = {'I':1,'V':5,'X':10,'L':50,'C':100,'D':500,'M':1000,'IV':4,'IX':9,'XL':40,'XC':90,'CD':400,'CM':900} | |
def roman_to_int(s): | |
i = 0 | |
num = 0 | |
while i < len(s): | |
if i+1<len(s) and s[i:i+2] in roman: | |
num += roman[s[i:i+2]] | |
i+=2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# github -> https://github.com/huzefamehidpurwala/Sorting-String-Python.git | |
s = input() # the alphanumeric string to be sorted | |
# defining empty lists to bifercate every index of the string respectively | |
strl_lst = [] | |
stru_lst = [] | |
num_lst = [] | |
extra_lst = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sys import argv # to take length of the password from the user from the cli command itself | |
from random import choice # to select random elements from an iterable | |
from string import ascii_letters, punctuation, digits # string of characters, special_chars and digits | |
# from os import system | |
def makepass(x, pas="") -> str: | |
assert x > 5, "Length of Password should be greater than 8" | |
x = x - len(pas) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from time import sleep | |
import openpyxl | |
from datetime import datetime | |
print("Welcome!\nWe are working...!") | |
# Get the current date and time | |
now = datetime.now() | |
worksheet_title = now.strftime("%Y-%m-%d") # for time %H-%M-%S |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pyautogui | |
import time | |
with open("asin.txt", "r") as asins: | |
time.sleep(3) | |
for line in asins.readlines(): | |
pyautogui.typewrite(line) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from os import system | |
system("cls") | |
flag = True | |
while flag: | |
string = input("Enter the words: ").split() | |
system("cls") | |
if not string: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from string import whitespace, punctuation, digits, ascii_lowercase as letters | |
# from enchant import Dict | |
from requests import get | |
dic1 = dict() | |
dic2 = dict() | |
for i, l in enumerate(letters): | |
dic1.update({l.lower(): i}) | |
dic1.update({i: l.upper()}) | |
dic2.update({l.upper(): i}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace BollywoodGame | |
{ | |
internal class Program | |
{ |
OlderNewer