How would I compute this complex formula in python? [(2 - 5)^13 / [(157 + 594 * 7)^23 % 1337]-4^19] % 664 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How would I compute this complex formula in python? [(2 - 5)^13 / [(157 + 594 * 7)^23 % 1337]-4^19] % 664

Python computation/Coding.

19th May 2020, 3:51 AM
John Perez
John Perez - avatar
11 Answers
0
There is a youtube channel about hacking that I enjoy a lot, it's called Live Overflow. It is worth checking it out if you have the time!
19th May 2020, 4:36 AM
Eduardo Petry
Eduardo Petry - avatar
+ 1
Use ( ) instead of [ ], and ** instead of ^ for exponentiation, et voilà. Don't forget to print the result, though, or else you won't get any output.
19th May 2020, 4:05 AM
Eduardo Petry
Eduardo Petry - avatar
+ 1
So do I replace the brackets with another parentheses?
19th May 2020, 4:09 AM
John Perez
John Perez - avatar
+ 1
John Perez Exactly, and replace every ^ with **. Then put the whole expression inside print( ) so it gets evaluated and the output is printed to your screen.
19th May 2020, 4:11 AM
Eduardo Petry
Eduardo Petry - avatar
+ 1
Okay so I did that in the coding playground and got a really long negative float number and a trace back error. Is that correct?
19th May 2020, 4:14 AM
John Perez
John Perez - avatar
+ 1
Worked for me, here is the code. https://code.sololearn.com/c456FXI5pVTw/?ref=app
19th May 2020, 4:18 AM
Eduardo Petry
Eduardo Petry - avatar
+ 1
Ah okay I see what I did wrong, I put two parentheses at the beginning and not three like you did everything else I did correctly. Thank you so much that formula has been the bane of my existence for quite some time!
19th May 2020, 4:21 AM
John Perez
John Perez - avatar
+ 1
I see hahah 😆 glad that I could help!
19th May 2020, 4:23 AM
Eduardo Petry
Eduardo Petry - avatar
+ 1
I have another question for you I'm not sure if you'll be able to assist with this one but any info is better than none. I am currently in school for cyber security and I want to be a red team member. I've asked my professor on what it is I should be focusing on to make my way towards being a red team member, but hes always vague about it and I've done alot of research and have a general idea of where to start. But if you know anything about being a red team member for cyber security any guidance would be greatly appreciated. What should I invest my time in to improve my coding and prepare myself for the A+, Security + certs and many more?
19th May 2020, 4:26 AM
John Perez
John Perez - avatar
+ 1
To be honest I don't know much about it, but seems very interesting. Being on the red team means thinking like an attacker and trying to exploit vulnerabilities on the defenses of systems. I found this reading to be quite good: https://securitytrails.com/blog/cybersecurity-red-blue-team
19th May 2020, 4:35 AM
Eduardo Petry
Eduardo Petry - avatar
+ 1
Yes I always have time and if I dont I'll make it, I will definitely check them both out thank you again you've been a big help Ed!
19th May 2020, 4:38 AM
John Perez
John Perez - avatar