Home > other >  About python3/,//, % three symbols of understanding, learn simple recursive functions
About python3/,//, % three symbols of understanding, learn simple recursive functions

Time:12-03

I am a beginner rookie ha

For the three symbols are still a little confused, please great god answer

/this symbol should be well understood, it is divided by mathematics. Ps: if I say too full, please correct me, thank you

//and % is I have been very confused

#//



# %



Wish you a helping hand, ha, ha, ha
For this cause I am in recursive learning, very confused
As follows:

Def f (x) :
If x>=2:
F (x//2)
Print (x % 2, end=' ')

F (8)

Def proc (n) :
If n & lt; 0:
Print (' - 'end=' ')
N=- n
If n//10:
Proc (n//10)
Print (n % 10, end=' ')

Proc (345)

CodePudding user response:

Grasp two points:
A/b as a result of the whole down
The result of a % b is a - b * (a/b)

CodePudding user response:

reference 1st floor chuifengde response:
seized two points:
A/b as a result of the whole down
The result of a % b is a - b * (a/b)


Kiss you see this a few I used the wrong way or are you talking about

2-5%

2-5% - PS: this is the

3-6.8%

6.8% 3

- 4.1% - 1

CodePudding user response:

Where is it?

refer to the second floor patrickstar231 response:
Quote: refer to 1st floor chuifengde response:

Grasp two points:
A/b as a result of the whole down
The result of a % b is a - b * (a/b)


Kiss you see this a few I used the wrong way or are you talking about

2-5%

2-5% - PS: this is the

3-6.8%

6.8% 3

- 4.1% - 1

Where is it?

CodePudding user response:

3-6.8% of results:
We first calculate by three - 3-6.8//
Then the remainder - 6.8-3 * (3)=6.8 + 9=2.2

6.8% 3 results:
First is 6.8//3 to 2
Then the remainder 6.8 3 * (2)=0.8 or 0.7999999...