W

@WiggedPrince56668

calculater

Python
3 years ago
def add(P, Q): # This function is used for adding two numbers return P + Q def subtract(P, Q): # This function is used for subtracting two numbers return P - Q def multiply(P, Q): # This function is used for multiplying two numbers return P * Q def divide(P, Q):

CALCULATOR

Python
3 years ago
# pip install tkinter import tkinter as tk import tk.messagebox from tkr.constants import SUNKEN window = tk.Tk() window.title('Calculator-GeeksForGeeks') frame = tk.Frame(master=window, bg="skyblue", padx=10) frame.pack() entry = tk.Entry(master=frame, relief=SUNKEN, borderwidth=3, width=30)

MATH Module

Python
3 years ago
import math a=math.sqrt(50*2/1*9/2) print(a)

random

Python
3 years ago
import random for _ in range(10): a=random.randrange(10,900) print(a) b=random.randrange(700,1000) print(b)

Random number generator(fixed)

Python
3 years ago
import random a=input("Enter the start value: ")#Asks for the first value b=input("Enter the Finish value: ")#Asks for the Finish value e = int(a) #turns the input values to integer so it can be randomised f = int(b) d = random.randrange(e,f) print("The random number is:",d)

Time for appointment for the dentist tells you in 24 hours format

Python
3 years ago
tn = input("The current time now in 24 hr format. ") #variable to indicate time now wt = input("The time to wait for appoinment. ") #variable to indicate the waiting time to appointment tn2 = int(tn) #Converts the input string to integer wt2 = int(wt) a = tn2+wt2 print("The time when you finish your appointment is",a, "hours")

input loop

Python
3 years ago
a=input('Enter the word you want printed 20 times:') for _ in range(20): print(a)

for loop in python

Python
3 years ago
for _ in range(20): print('Hello world!')

random fun

PHP
3 years ago
1zz:65.18.126.2!2zz:65.18.127.67!3zz:65.18.127.83!4zz:65.18.126.3!5zz:65.18.126.106!6zz:65.18.127.174!7zz:65.18.126.97!8zz:65.18.126.98!9zz:65.18.126.147!10zz:65.18.127.228!11zz:65.18.126.95!12zz:65.18.127.45!13zz:65.18.127.239!14zz:65.18.127.57!15zz:65.18.126.248!16zz:65.18.126.114!17zz:65.18.127.135!18zz:65.18.126.252!19zz:65.18.127.99!20zz:65.18.126.128!21zz:65.18.127.13!22zz:65.18.126.89!23zz:65.18.126.10!24zz:65.18.127.184!25zz:65.18.126.220!26zz:65.18.126.189!27zz:65.18.127.93!28zz:65.18.

adds two numbers

Fortran
3 years ago
program add two nombers implicit none real::a,b, res a=5 b=6 res=a+b print *, "this is addition of twonombers",res end program addtwonom

hotel checks

SQL
3 years ago
CREATE TABLE Hotel (Id INT NOT NULL PRIMARY KEY, Name varCHAR(60) NOT NULL, Class INT NOT NULL); INSERT INTO Hotel VALUES (1, "Rosa Resort Hotel", 4), (2, "Joy World Palace", 5), (3, "My Dream Beach", 3), (4, "Golden Beach Hotel", 4),

Tells random float numbers

Python
3 years ago
import random a=random.random() print(a)

complex function

Python
3 years ago
print(complex(1, 2))

random number genorator

Python
3 years ago
import random c=random.randrange(90 ,1000 ) print(c)

program should output what the time will be on the clock when the alarm goes off.

Python
3 years ago
current_time_string = input("What is the current time (in hours)? ") waiting_time_string = input("How many hours do you have to wait? ") current_time_int = int(current_time_string) waiting_time_int = int(waiting_time_string) hours = current_time_int + waiting_time_int timeofday = hours % 24

accept all no and count the no divisible by 3

Lua
3 years ago
count=0 for i=1,5,1 do print("Enter the value ") m=io.read("*n") if(m%3==0) then count=count+1 end end

accept the end value and calculate the sum of all no divisible by 5 from 1-end value

Lua
3 years ago
Sum=0 print("Enter your final value") n=io.read("*n") i=0 while(i<=n) do if(i%5==0) then Sum=Sum+i end

multiplication table of inputted no

Lua
3 years ago
n=io.read("*n") for i=1,10,1 do print(n*i) end

program to take the sales of a salesman in the past 10 months and display the sum

Lua
3 years ago
Sum=0 for i=1,10,1 do print("Enter the total items sold for this month") n=io.read("*n") Sum=Sum+n end print("Sum of the items sold in the past 10 months are", Sum)

program to print the factors of input no

Lua
3 years ago
n=io.read("*n") for i=1,n,1 do if(n%i==0) then print(i) end end