Posts

Showing posts from June, 2019

#4l: Drawing in Python {SPIRAL}

Image
This is to inform that 'drawing in python' contents are made using "help()" and ability to explore contents. I> import turtle as t def cmagic(y):     import turtle as t     t.speed(y)     x=float(0.027)     for i in range(1):                  for k in range(1,38):             x=x+0.027                         if x>1:                                  x=1                 for g in range(1,36):                     x=x-0.027                     t.color(x,x,x)                                                                   t.fd(10)                     t.right(5)                                                       if x<1:                                  x=x                 t.color(x,x,x)                                                       t.fd(10)                 t.right(5) for i in range(1,37):     cmagic(0)          t.right(10) II> import turtle as t import random p=int(input('Enter number of sides of

#4k. Coding In Python {MORSE CODE CONVERTER}

Image
thisdict1={".-": "a", "-...":"b", "-.-.":"c", "-..":"d", ".":"e", "..-.":"f", "--.":"g", "....":"h", "..":"i", ".---":"j",  "-.-":"k", ".-..":"l", "--":"m", "-.":"n", "---":"o", ".--.":"p", "--.-":"q",   ".-.":"r", "...":"s", "-":"t", "..-":"u", "...-" :"v", ".---" :"w", "-..-":"x", "-.--":"y", "--..":"z"} thisdict2={'a':'.-',            'b':'-...',            'c':'-.-.',            'd':'

#4j:Coding in Python{TENSION FINDER}

Image
#tension print('Input tension to find tension.') j=str(input('Enter please: ')) w=str(input('Input yes if only 1 load is in water or no: ')) if w=='yes':     a1=int(input("Input 1 if you want gravity 10m/s**2 and Input 2 if you want gravity 9.8m/s**2"))     if a1==1:         vo=eval(input("Enter volume of object: "))         do=eval(input("Enter density of object: "))         dl=eval(input("Enter density of liquid: "))         g=10         t=(((vo)*g)*(dl-do))         print("Tension is ",t," N")     if a1==2:         vo=eval(input("Enter volume of object: "))         do=eval(input("Enter density of object: "))         dl=eval(input("Enter density of liquid: "))         g=9.8         t=(((vo)*g)*(dl-do))         print("Tension is ",t," N") else:     print('Input 1 when loads are parallel to surface.')     q=int(input

#4i: Coding in python:{FACTORIAL FINDER}

Image
#factorial_finder from functools import reduce def pro(a,b):     return a*b x=int(input("Enter number: ")) z=[] for t in range(1,x+1):     z.append(t) fact=reduce(pro,z) print('Factorial of ',x,' is ',fact,'.') Download  CODES  here. For online Python  CLICK Here .