Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
why it's not printing?
#1
Hey all,
Im working through "The Self-taught programmer" by Cory Althoff.
I'm doing the exercises at the end of chapter 2, and i'm having two difficulties.

1. I'm suppose to "create a program that divides two variables and prints the remainder." When I input
"100 % 15" into the shell, I get output of "10", which is what I wanted. But when I input the exact same into a file, and then run module, I just get a restart message in the shell. how do I get the file to print the remainder in the shell?

2. Why is "10 // 0.1" giving the answer "99.0" , but "100 // 1" is giving answer 100? Both should be 100, so why 99.0 then?

Thank you,
Steve
Reply


Messages In This Thread
why it's not printing? - by nickto21 - Aug-15-2019, 10:59 PM
RE: why it's not printing? - by ichabod801 - Aug-15-2019, 11:11 PM
RE: why it's not printing? - by nickto21 - Aug-15-2019, 11:26 PM
RE: why it's not printing? - by scidam - Aug-16-2019, 12:41 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020