LINUX LITE 7.2 FINAL RELEASED - SEE RELEASE ANNOUNCEMENTS SECTION FOR DETAILS


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Beginning with Python
#29
I noticed a lot of people (and me too) have trouble with this one initially, so I decided to add it here to save people time so they can understand it sooner and continue the learning rather than get hung up on more advanced details if searching about it.

% - Modulus explained -

100-25*3%4
answer 97

Why -
25*3%4
25*3=75
75%4
answer 3

How it works -
75 divided into 4= 18 times
18x4=72
75-72= r3
%=3

Actual calculation at the final stage is -
100-3
so it is why the answer was 97


First of the ex3 explained

3+2+1-5+4%2-1/4+6

3+2+1=6
6-5=1
4%2=0  (4 divided into 2=2, zero remains, modulus %=0)
1+0=1
1/4=0 (1 cannot divide into 4 using whole numbers)
1-0=1
1+6=7
so it is why the answer was 7

I used Python calculating to work it out.
Just open python in terminal then trial error the various breakdowns until I understood what was happening.
Which was part of the #2 extra practices, so it also means can multi-task and 2 things at same time, if trying this.

I hope it helps someone else learning if they get stuck on modulus.
Reply


Messages In This Thread
Beginning with Python - by bitsnpcs - 10-23-2014, 05:46 PM
Re: Beginning with Python - by Scott(0) - 10-23-2014, 06:51 PM
Re: Beginning with Python - by bitsnpcs - 10-24-2014, 12:49 AM
Re: Beginning with Python - by Scott(0) - 10-24-2014, 03:25 AM
Re: Beginning with Python - by bitsnpcs - 10-24-2014, 05:13 AM
Re: Beginning with Python - by bitsnpcs - 11-02-2014, 12:08 AM
Re: Beginning with Python - by Wirezfree - 11-02-2014, 12:14 AM
Re: Beginning with Python - by bitsnpcs - 11-02-2014, 02:13 AM
Re: Beginning with Python - by Wirezfree - 11-02-2014, 07:22 PM
Re: Beginning with Python - by bitsnpcs - 11-02-2014, 09:16 PM
Re: Beginning with Python - by audiot3k - 12-30-2014, 07:52 AM
Re: Beginning with Python - by avj - 02-16-2015, 02:32 AM
Re: Beginning with Python - by bitsnpcs - 02-16-2015, 09:05 PM
Re: Beginning with Python - by avj - 02-16-2015, 09:12 PM
Re: Beginning with Python - by Hans - 03-22-2015, 08:42 AM
Re: Beginning with Python - by bitsnpcs - 01-27-2017, 01:21 AM
Re: Beginning with Python - by bitsnpcs - 02-11-2017, 09:46 PM
Re: Beginning with Python - by torreydale - 02-12-2017, 01:54 PM
Re: Beginning with Python - by bitsnpcs - 02-12-2017, 04:27 PM
Re: Beginning with Python - by torreydale - 02-12-2017, 04:47 PM
Re: Beginning with Python - by bitsnpcs - 02-12-2017, 05:18 PM
Re: Beginning with Python - by LL-user - 02-12-2017, 10:18 PM
Re: Beginning with Python - by bitsnpcs - 02-13-2017, 12:44 AM
Re: Beginning with Python - by LL-user - 02-13-2017, 04:19 AM
Re: Beginning with Python - by bitsnpcs - 02-13-2017, 08:27 PM
Re: Beginning with Python - by bitsnpcs - 02-22-2017, 12:34 AM
Re: Beginning with Python - by bitsnpcs - 04-03-2017, 03:40 PM
Re: Beginning with Python - by bitsnpcs - 04-14-2017, 06:12 AM
Re: Beginning with Python - by bitsnpcs - 04-15-2017, 02:27 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)