On my PC this code does not work correctly | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

On my PC this code does not work correctly

https://code.sololearn.com/coYd23aPT1kO/?ref=app

26th May 2019, 9:28 AM
krypto0n
krypto0n - avatar
33 Answers
+ 6
To me, I changed latnum for latnum on line 33, as Asterisk pointed out and tested. Two numbers came out, a big (4 digits) and a small one (1 digit). A question: you never use min and max. Was the idea of the code to produce numbers between 999 and 9999?
26th May 2019, 9:58 AM
D.R.
D.R. - avatar
+ 6
One important problem: the if statements test if the numbers are greater than the next, but they won't give out a satisfactory result in case any number is equal to another. Last attempt produce 6799 and resulted in 6. Probably because 9 (thirdnum) and 9 (lastnum) are the same. Check with >= instead of >. See what happens.
26th May 2019, 10:15 AM
D.R.
D.R. - avatar
+ 6
One last suggestion: after thirdnum, you don't do the division of num by 10 and lastnum can thus still be a two digit number. Also, instead of dividing lastnum by 10, try lastnum with modulus %.
26th May 2019, 10:22 AM
D.R.
D.R. - avatar
+ 4
*Code removed*
26th May 2019, 11:10 AM
D.R.
D.R. - avatar
+ 3
line 33 last num and not latnum
26th May 2019, 9:48 AM
✳AsterisK✳
✳AsterisK✳ - avatar
+ 3
SoloLearn uses an online compiler
26th May 2019, 10:22 AM
✳AsterisK✳
✳AsterisK✳ - avatar
+ 1
This is syntaxe problem and you have many errors. Your code is also confusing. Please write your code from the beginning and ident the code.
26th May 2019, 9:31 AM
Werg Serium
Werg Serium - avatar
+ 1
Yeah I meant "num"
26th May 2019, 9:34 AM
[Abandoned]
[Abandoned] - avatar
0
They gave a traceback for a reason. Your variable number doesn't exist.
26th May 2019, 9:28 AM
[Abandoned]
[Abandoned] - avatar
0
I didn't understand...
26th May 2019, 9:31 AM
krypto0n
krypto0n - avatar
0
He didn't even declare the variable "num"
26th May 2019, 9:32 AM
Werg Serium
Werg Serium - avatar
0
There are no such errors on PC
26th May 2019, 9:32 AM
krypto0n
krypto0n - avatar
0
Or he wanted to say "num1", but he says "num"
26th May 2019, 9:33 AM
Werg Serium
Werg Serium - avatar
0
The problem is not your pc dude. It's your code.
26th May 2019, 9:33 AM
Werg Serium
Werg Serium - avatar
0
And you have many errors. I think that the best thing to do is start from the beginning.
26th May 2019, 9:34 AM
Werg Serium
Werg Serium - avatar
0
Well there is a problem with an else if without a expression. In every condition you must have an expression inside.
26th May 2019, 9:36 AM
Werg Serium
Werg Serium - avatar
0
I wrote off code from the PC, may have written with an error
26th May 2019, 9:37 AM
krypto0n
krypto0n - avatar
0
You made a lot of mistake, but it's just syntaxe errors. It can easily be fixed
26th May 2019, 9:38 AM
Werg Serium
Werg Serium - avatar
0
Do not look at syntax errors
26th May 2019, 9:46 AM
krypto0n
krypto0n - avatar
0
Important. Code does not always output the biggest numeral
26th May 2019, 9:48 AM
krypto0n
krypto0n - avatar