+ 3

What have i done wrong? Cant you write a == i

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

22nd Apr 2019, 9:19 AM
Kristi Teneqexhi
Kristi Teneqexhi - avatar
8 Respuestas
+ 3
Kristi Teneqexhi if a <=1: a *= -1 Input 1 --> a = -1 I think you want to avoid negative numbers. if a < 0: a* = -1 0 is also not working, so you have to decide what you want to do with it. Maybe this? if a == 0: a = 1
22nd Apr 2019, 9:51 AM
Denise Roßberg
Denise Roßberg - avatar
+ 6
Indentation matters in Python. Try indenting line 12 and 13 to group them under the if block.
22nd Apr 2019, 9:29 AM
Hatsy Rei
Hatsy Rei - avatar
+ 4
if a == i: //print...
22nd Apr 2019, 9:21 AM
Denise Roßberg
Denise Roßberg - avatar
+ 4
It says time limit exceeded
22nd Apr 2019, 9:35 AM
Kristi Teneqexhi
Kristi Teneqexhi - avatar
+ 4
Denise Roßberg i know it is pointless but i just wanted to practise cause you can simply write Print ("your number is:", a) After some changes it is finally done https://code.sololearn.com/cYKe4Hd7tVWB/?ref=app
22nd Apr 2019, 10:02 AM
Kristi Teneqexhi
Kristi Teneqexhi - avatar
+ 3
Kristi Teneqexhi I know. But a code for practising does not need any sense ;)
22nd Apr 2019, 11:33 AM
Denise Roßberg
Denise Roßberg - avatar
+ 2
Oh ok
22nd Apr 2019, 9:52 AM
Kristi Teneqexhi
Kristi Teneqexhi - avatar
0
no these are two different variables
22nd Apr 2019, 1:51 PM
Malebu
Malebu - avatar