Posts

Showing posts from November, 2020

#4v: Coding in Python {Simultaneous Equations}

Image
print (' mx + ny + z = 0') print (' ax + by + c = 0') m=int(input("Enter m: ")) n=int(input("Enter n: ")) z=int(input("Enter z: ")) a=int(input("Enter a: ")) b=int(input("Enter b: ")) c=int(input("Enter c: ")) y = ((m*c) - (a*z))/((a*n) - (b*m)) x = ((-1 * b * y ) -c)/a print(x) print(y)

How play Sounds of .MP3 and .wav in Python

Image
 To play a sound there are various ways but I 'll be telling u the easiest .   Using playsound Installing Playsound module :            1) Open Command Prompt               - Go to Start and search for cmd.               - OR press Windows + R and in the dialogue box type 'cmd' and then OK.        2) In the Command Prompt type  py -m pip install -U playsound --user   .        3) After few seconds it will start downloading. How to use playso un d?               import playsound     playsound.playsound( '<location of audio file>' , True )         Example: If location of file is inside Local Disk E and inside Minim TOTALCOOLSTUFFS and then inside MP3 and name of file is hello .mp3. Then the location of file will be : E:\Minim TOTALCOOLSTUFFS\MP3\hello.mp3 The location is case as well as space sensitive. Run the program and the sound will start playing after few seconds.