Title |
User |
Message |
Date Posted |
Re: why doesnt it work? |
Mehar_S |
print(int(variable) only rounds to 166, and there is no syntax error, can someone look at my code and tell me whats wrong? |
Jan 20, 2016 - 11:56:21 pm UTC |
Re: why doesnt it work? |
Venkat24 |
also if its not working check what the peg judge says, if its says traceback or a.out line normally its a syntax error |
Jan 20, 2016 - 11:47:39 pm UTC |
Re: why doesnt it work? |
Venkat24 |
did you use the print(int(variable) in which it rounds the number so that it becomes 167 instead of 166.666...? |
Jan 20, 2016 - 11:46:51 pm UTC |
why doesnt it work? |
Mehar_S |
my code works with the samples, why is it only getting 60 when i submit it? |
Jan 20, 2016 - 11:22:26 pm UTC |
Re: pls help |
royanitra04 |
Hey Venkat, when rounding in python3, you can do "print(int(V)"(in your case). |
Jan 17, 2016 - 9:47:36 pm UTC |
Re: pls help |
jargon |
Research the % operator. |
Jan 17, 2016 - 8:40:52 pm UTC |
Re: pls help |
Venkat24 |
Ive also been researching the round() command in python and string formatting, it itself, and even other commands (e.g. import decimal) isnt working! |
Jan 17, 2016 - 3:25:06 am UTC |
Re: pls help |
Venkat24 |
Even when using round command, with floats, i get 166.66666... |
Jan 17, 2016 - 3:19:09 am UTC |
pls help |
Venkat24 |
my code is correct, its just that i cant round the output(e.g. output=166.666666...) |
Jan 17, 2016 - 3:15:29 am UTC |