Download Source Code:- bit.ly/3NMai3P • *Please Be Sure To Like this video, and Subscribe to my Channel* =================================================== *◘ My other Programming Tutorials →* My Python Tutorial Playlist : tiny.cc/amwaqz Print squares of numbers from 1 to x (Java): ruclips.net/video/L5wlwj8P06M/видео.html Multiplication Tables of Number (Java): ruclips.net/video/BhVJtQJFxNQ/видео.html Auto Typer (Visual Basic Script): ruclips.net/video/g1uI31Ck_DM/видео.html Prank Virus (Visual Basic Script): ruclips.net/video/Uz7WxR-iteA/видео.html =================================================== *• Some of my How-to Tutorials →* Add Custom Theme to IDLE: ruclips.net/video/JG9GedugQ1A/видео.html Change OEM information on Windows: ruclips.net/video/PeU7YsLH6cE/видео.html Add Icons to Folders: ruclips.net/video/XEPFr2UsI44/видео.html Change skin of your mouse cursor: ruclips.net/video/JG9GedugQ1A/видео.html Download RUclips videos using VLC: ruclips.net/video/Jo0kygEzUz0/видео.html Change Lockscreen Background in Windows 7: ruclips.net/video/zyumc20nH50/видео.html
@Pizza345 print(" ") is used to print an empty line. is an escape character, that is used to break a line. The next line just prints a statement. It uses an f-string, which is used to substitute value of a variable (inside { }) without concatenating the string. Its an alternative to string's format() method. Read more here - www.geeksforgeeks.org/formatted-string-literals-f-strings-python/amp/
Hello, Why I don't have the roots' results in the end? I followed all the steps and when I try to run the program the final line writes: Type of Roots: Two Distinct Real Roots Thank you in advance!
Check if you didn't forget to print the roots...If you didn't then contact me on Instagram (@techy_sharnav) or Discord (TechySharnav#1615) with the code
Hello Sharnav, I dont seem to understand why my program is not running. I believe that I followed your instructions precisely. please let me know what I did wrong.
This is what I got import cmath >>> print("General Form: - a**2 + bx + c = 0") General Form: -a**2 + bx + c = 0 >>> a = int(input("Enter a (a != 0): ")) Enter a (a != 0): 1 >>> b = int(input("Enter b:")) Enter b:3 >>> c = int(input("Enter c: ")) Enter c: 4 >>> d = (b**2) - (4*a*c) >>> sol1 = (-b-cmath.sqrt(d))/(2*a) >>> sol2 = (-b+cmath.sqrt(d))/(2*a) >>> print(" ") >>> print(f"Results for equation, {a}x**2 + {b}x + {c} =0, are :- ") if d>0: print("Type of Roots : Two Distinct Real Roots") elif d == 0: print("Type of Roots : Two Equal Real Roots") elif d < 0: print("Type of Roots : Two Complex Roots") print(f"The solutions are {sol1} and {sol2}")
First, ** is a standard notation for exponents. Therefore, it would be 5*x**3 (equivalent to 5x³). Now If I got you correctly, the entire 5x³ term is an input, right?
@@selvaajith4384 Divide the term by 5. You get x**3 term. Now take cube root of it, by raising it to power 1/3. Now Take Square of it, and multiply by 5. You get your desired output. Here's a small snippet to help you out:- gist.github.com/TechySharnav/29c9dd3235145de0496812953b4b4a06
@@SharnavTech hai sir...... Sorry to disturbing you..... One more doubt sir....... Same question if user give input as 5*x***3+5*x**2+5*x+5=0 Output be like 5*x**2+5*x+5=0(decrease the x value ) but we solve it with list, array, and for loop........help me sir
You are using print(f"results for equation.....) In this line error exist please help how to remove this error and the error is based on ("") in worded comma's
'f' here denotes that we will be formatting the string. These strings are also called F-Strings. The basic usage of f strings is to make string interpolation easier.
Sorry it's not mandatory to tell the name of your school/college/university here, that's very lame . And, if it comes to cheating in online exams using this that's not his problem it's the problem of the schools they must keep enough maintenance so that a child can't cheat. Here is just a tutorial given for people to solve algebraic problems using python and that's a very good job don't spread hatred spread love 😇😇
@@SharnavTech yeah but how can i merge that with text? like if we had print(f"The solutions are {sol1} and {sol2}"), where should we put .real? because I guess I tried all combinations but none worked.
hello man, i have 2 questions 1-does cmath matter? Because i used normal x1= ...d**0.5... and it works! 2- is there a way to make this code faster? i use qpython3l to code most of the time so it would useful for me. appreciated
1. No, cmath doesn't really matter. You can also do **0.5 2. Not really. The only time you can save is while entering the input. Instead of asking user to enter coefficient one by one, you can ask him to enter comma separated values. a,b,c = [int(i) for i in input("Enter a, b, c: ").split(",")]
File "D:\Visual Studio\Projects\quadratic formula\quadratic formula\quadratic_formula.py", line 12 sol2 = (-b+cmath.sqrt(d)/(2*a) ^ SyntaxError: invalid syntax Press any key to continue . . . is the only result I get from this program 😶 where did i f up...
Sorry, I had the video made in a rush...Can you give feedback on my latest videos? They have improved a lot.... And it is not Google Translate Voice :)
Hello, can you solve this question Consider the equation Ax2 + B = 0. If B/A < 0, this equation has two solutions. The solutions are: (1) X1 = Sqrt(-B/A) (2) X2 = −Sqrt(-B/A) If B/A = 0, this equation has one solution which is X = 0 If B/A > 0, this equation has no real number solutions Draw a flowchart and Write a program to have the user input any numbers for the coefficients, A and B, for this equation. If A = 0, terminate the program. Otherwise, solve the equation.
Yeah, it's pretty easy. It would require multiple if elif conditions. Based on the condition, you can calc and print the output. Make sure to include a == 0 as 1st condition, since the program has to be terminated. I recommend you to try on your own first. If you get stuck or need help, I am here. :)
Download Source Code:- bit.ly/3NMai3P
• *Please Be Sure To Like this video, and Subscribe to my Channel*
===================================================
*◘ My other Programming Tutorials →*
My Python Tutorial Playlist : tiny.cc/amwaqz
Print squares of numbers from 1 to x (Java): ruclips.net/video/L5wlwj8P06M/видео.html
Multiplication Tables of Number (Java): ruclips.net/video/BhVJtQJFxNQ/видео.html
Auto Typer (Visual Basic Script): ruclips.net/video/g1uI31Ck_DM/видео.html
Prank Virus (Visual Basic Script): ruclips.net/video/Uz7WxR-iteA/видео.html
===================================================
*• Some of my How-to Tutorials →*
Add Custom Theme to IDLE: ruclips.net/video/JG9GedugQ1A/видео.html
Change OEM information on Windows: ruclips.net/video/PeU7YsLH6cE/видео.html
Add Icons to Folders: ruclips.net/video/XEPFr2UsI44/видео.html
Change skin of your mouse cursor: ruclips.net/video/JG9GedugQ1A/видео.html
Download RUclips videos using VLC: ruclips.net/video/Jo0kygEzUz0/видео.html
Change Lockscreen Background in Windows 7: ruclips.net/video/zyumc20nH50/видео.html
give me html version for all this so its become interective and we make parabola according to given conditions
Dude, thank you. Just finished my homework!
Welcome :)
@@SharnavTech Hey, do you mind explaining what line 9 and 10 do? Didn't get that part.
Can you please just point out the timestamp in the video?
@@SharnavTech 4:39 and the one after.
@Pizza345 print("
") is used to print an empty line.
is an escape character, that is used to break a line.
The next line just prints a statement. It uses an f-string, which is used to substitute value of a variable (inside { }) without concatenating the string. Its an alternative to string's format() method. Read more here - www.geeksforgeeks.org/formatted-string-literals-f-strings-python/amp/
Thank u bro! I was getting problem in complex no. but now it is solved. Thanks again!!
No problem!
I just finished my class work thank you
Glad I could help!
you just saved my life, thank you
welcome! :)
I like your explanation 😇
Thanks
tip: put it in a while statement where r= int(input()) and while r>0 run the code above for homeworks then r=r-1
SORRY GUYS AN WHILE STATEMENT
So you mean to ask user how many times they want to run the code, and use while loop for that?
@@SharnavTech yeah
great, thanks Sharnav
You're most welcome!!
@@SharnavTech bless you
Hello,
Why I don't have the roots' results in the end?
I followed all the steps and when I try to run the program the final line writes: Type of Roots: Two Distinct Real Roots
Thank you in advance!
Check if you didn't forget to print the roots...If you didn't then contact me on Instagram (@techy_sharnav) or Discord (TechySharnav#1615) with the code
Thanks alot 🤝🏿
Thanks, very helpful!
Glad you found it useful...!
Thank you,nice demonstrate
Welcome!!
thank you
Welcome
Hello Sharnav, I dont seem to understand why my program is not running. I believe that I followed your instructions precisely. please let me know what I did wrong.
This is what I got
import cmath
>>> print("General Form: - a**2 + bx + c = 0")
General Form: -a**2 + bx + c = 0
>>> a = int(input("Enter a (a != 0): "))
Enter a (a != 0): 1
>>> b = int(input("Enter b:"))
Enter b:3
>>> c = int(input("Enter c: "))
Enter c: 4
>>> d = (b**2) - (4*a*c)
>>> sol1 = (-b-cmath.sqrt(d))/(2*a)
>>> sol2 = (-b+cmath.sqrt(d))/(2*a)
>>> print("
")
>>> print(f"Results for equation, {a}x**2 + {b}x + {c} =0, are :-
")
if d>0:
print("Type of Roots : Two Distinct Real Roots")
elif d == 0:
print("Type of Roots : Two Equal Real Roots")
elif d < 0:
print("Type of Roots : Two Complex Roots")
print(f"The solutions are {sol1} and {sol2}")
Connect with me on Discord (TechySharnav#1615) or Instagram (@techy_sharnav)
Sir, how can i decrese the power of x value? For example, input is 5*x***3 expecting output is 5*x**2
First, ** is a standard notation for exponents. Therefore, it would be 5*x**3 (equivalent to 5x³).
Now If I got you correctly, the entire 5x³ term is an input, right?
@@SharnavTech Right sir...... How can i decrese the power of x in my output..... Plz help me
@@selvaajith4384 Divide the term by 5. You get x**3 term. Now take cube root of it, by raising it to power 1/3. Now Take Square of it, and multiply by 5. You get your desired output.
Here's a small snippet to help you out:-
gist.github.com/TechySharnav/29c9dd3235145de0496812953b4b4a06
@@SharnavTech thank you sooooooooooo much sir
@@SharnavTech hai sir...... Sorry to disturbing you..... One more doubt sir....... Same question if user give input as 5*x***3+5*x**2+5*x+5=0
Output be like 5*x**2+5*x+5=0(decrease the x value ) but we solve it with list, array, and for loop........help me sir
Ohh my god
Thanks man
Welcome
You are using print(f"results for equation.....) In this line error exist please help how to remove this error and the error is based on ("") in worded comma's
Use triple quotes to put both single quotes and double quotes in a string.
Example: print(f'''results ....''')
@@SharnavTech why we use f here
'f' here denotes that we will be formatting the string. These strings are also called F-Strings.
The basic usage of f strings is to make string interpolation easier.
Hello, an IITian here, please don't teach students how to cheat during online test as students below 11th grade have their test online ...😇😇
Thanks for exposing the idea to everyone 🙂
Sorry it's not mandatory to tell the name of your school/college/university here, that's very lame . And, if it comes to cheating in online exams using this that's not his problem it's the problem of the schools they must keep enough maintenance so that a child can't cheat. Here is just a tutorial given for people to solve algebraic problems using python and that's a very good job don't spread hatred spread love 😇😇
He was joking ig..
@@thunderboiii415 Grow up kid, that was a joke, stop being toxic
is there a way to print only real values? so just to make 0*j=0
You can use the .real property to get the real part of complex number.
For example, if X is the complex number, you can do print(X.real)
@@SharnavTech yeah but how can i merge that with text? like if we had print(f"The solutions are {sol1} and {sol2}"), where should we put .real? because I guess I tried all combinations but none worked.
sol1 and sol2 are variables, so you can do print(f"...{sol1.real} and {sol2.real}")
hello man, i have 2 questions
1-does cmath matter? Because i used normal x1= ...d**0.5... and it works!
2- is there a way to make this code faster? i use qpython3l to code most of the time so it would useful for me.
appreciated
1. No, cmath doesn't really matter. You can also do **0.5
2. Not really. The only time you can save is while entering the input. Instead of asking user to enter coefficient one by one, you can ask him to enter comma separated values.
a,b,c = [int(i) for i in input("Enter a, b, c: ").split(",")]
please try to upload without background music, it's vert distracting. Thank you
Yes, I have changed and lowered the background music's volume in my latest videos.
@@SharnavTech thank you so much
No problem!
It's 2:30 am and I got a test from IT class
Hopefully I understand something 💀
All the best for your test!
what is the use of this formula in softwere world i m new in computer world this is why this question came in my mind
Well... technically it doesn't have much practical use cases. It is mostly used for personal projects.
Actually we create a variable to define its vale in some memory..sir corret me if im wrong
Why that 0j is getting printed in the result ?
'j' denotes an imaginary part of complex number. If the solution is real, it will print 0j, which means it has no imaginary part
@@SharnavTech ohh ok thanks
how do i make it so that the numbers are fractions and not decimals?
Check at stackoverflow.com/q/23344185/9256189
@@SharnavTech thank you
nice
Thanks!
File "D:\Visual Studio\Projects\quadratic formula\quadratic formula\quadratic_formula.py", line 12
sol2 = (-b+cmath.sqrt(d)/(2*a)
^
SyntaxError: invalid syntax
Press any key to continue . . .
is the only result I get from this program 😶 where did i f up...
You are missing a closing ')' bracket in the numerator.
It should be
sol2 = (-b+cmath.sqrt(d))/(2*a)
@@SharnavTech thanks, I solved it yesterday
I appreciate that you magnify the code so it is easy to read. But I hate the music.
Thanks and Sorry for that. I have changed the music now.
I'm sure your tutorial is nice and all, but the combination of that music + the Google Translate voice made me wanna end it all
Sorry, I had the video made in a rush...Can you give feedback on my latest videos? They have improved a lot....
And it is not Google Translate Voice :)
hello, cod2
Hi (it's cod bo 2 to be precise)
Hello, can you solve this question
Consider the equation Ax2 + B = 0.
If B/A < 0, this equation has two solutions. The solutions are:
(1) X1 = Sqrt(-B/A)
(2) X2 = −Sqrt(-B/A)
If B/A = 0, this equation has one solution which is X = 0
If B/A > 0, this equation has no real number solutions
Draw a flowchart and Write a program to have the user input any numbers for the coefficients, A and B, for this equation. If A = 0, terminate the program. Otherwise, solve the equation.
Yeah, it's pretty easy. It would require multiple if elif conditions. Based on the condition, you can calc and print the output. Make sure to include a == 0 as 1st condition, since the program has to be terminated.
I recommend you to try on your own first. If you get stuck or need help, I am here. :)