Kindly explain the highlighted thing

Greetings fellow learners, it is requested to explain what does the circled thing do? Please explain in easy to understand words. Thanks

Hello @Talha,

The explanation for math.cell can be found here.

% is the modulo operator. E.g. 10 % 3 returns the remainder of 10/3 which is 1.

The code means if the remainder is zero, it prints the message inside pinrt(...).

The message is a “f-string”, and a “f-string” allows you to embed variables into the message. {i} will embed the value of the variable i into the message, and {i: 4d} will embed the value of the variable using a certain format as defined by the format string 4d. I think this page has a good summary of the format strings.

What does % mean here then?
also * seems to mean something different here too?

1 Like

Hi!

The % as used in this context is an IPython magic command.

The specific command %matplotlib inline tells matplotlib to use static images in the notebook.
See here

The * after import stands for everything.

So the line from utils import *
should be read as:
from utils import everything

If you want to know more details check out this StackOverflow post.

Hope this helps :slight_smile: