Jump to content
3 minutes ago, coyotetracker said:

image.png.4523af5e2a75cb6462ab2d275da56dbb.png       Whats wrong with this bit of code? I think the problems are down at the print statement but I'm not sure. Please let me know your thoughts about this.  

What language is it?

Intel® Core™ i7-12700 | GIGABYTE B660 AORUS MASTER DDR4 | Gigabyte Radeon™ RX 6650 XT Gaming OC | 32GB Corsair Vengeance® RGB Pro SL DDR4 | Samsung 990 Pro 1TB | WD Green 1.5TB | Windows 11 Pro | NZXT H510 Flow White
Sony MDR-V250 | GNT-500 | Logitech G610 Orion Brown | Logitech G402 | Samsung C27JG5 | ASUS ProArt PA238QR
iPhone 12 Mini (iOS 17.7) | iPhone XR (iOS 17.7) | KZ AZ09 Pro x KZ ZSN Pro X | Sennheiser HD450bt
Intel® Core™ i7-1265U | Kioxia KBG50ZNV512G | 16GB DDR4 | Windows 11 Enterprise | HP EliteBook 650 G9
Intel® Core™ i5-8520U | WD Blue M.2 250GB | 1TB Seagate FireCuda | 16GB DDR4 | Windows 11 Home | ASUS Vivobook 15 
Intel® Core™ i7-3520M | GT 630M | 16 GB Corsair Vengeance® DDR3 |
Samsung 850 EVO 250GB | macOS Catalina | Lenovo IdeaPad P580

Link to post
Share on other sites

12 minutes ago, coyotetracker said:

image.png.4523af5e2a75cb6462ab2d275da56dbb.png       Whats wrong with this bit of code? I think the problems are down at the print statement but I'm not sure. Please let me know your thoughts about this.  

Order of operations still applies in programming as it does in math. The code will execute b / 2 before a + b.

Link to post
Share on other sites

4 hours ago, SoulWolfX said:

U forgot the "'s and get rid of the ) at the end you only need one

You don't need quotes around any of it, since print() is fine printing numbers.

 

And the final ) is needed, since the first one closes the call to MathUtils.average().

If they only had 1 ), the code wouldn't run.

 

Like a few people have said, it was due to the brackets missing around (a + b) to ensure that the addition is done first.

CPU: 6700k GPU: Zotac RTX 2070 S RAM: 16GB 3200MHz  SSD: 2x1TB M.2  Case: DAN Case A4

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×