0

Why can't this work ??

x=1 A=0 B=0 n=input ("n") while x<=int(n): A=A+10^(4-x) B=A+10^(3-n) x=x+1 print (A,B)

10th Feb 2017, 4:01 PM
Rong Xiu Chen
Rong Xiu Chen - avatar
10 Answers
+ 6
i posted it look in my codes it is called test
10th Feb 2017, 4:24 PM
Georgios Markou
Georgios Markou - avatar
+ 3
n is a string "n" and u cannot convert "n" to a decimal number. Replace the "^" by "**"
10th Feb 2017, 4:07 PM
Georgios Markou
Georgios Markou - avatar
+ 3
n has to be a number to compare it try to specify it as an int or a float try it at your pc
10th Feb 2017, 4:15 PM
Georgios Markou
Georgios Markou - avatar
+ 3
should i post a code?
10th Feb 2017, 4:20 PM
Georgios Markou
Georgios Markou - avatar
+ 3
it would be nice i u could upvote my code :) and your welcome
10th Feb 2017, 4:28 PM
Georgios Markou
Georgios Markou - avatar
0
then what should I do to compare x to n ?
10th Feb 2017, 4:14 PM
Rong Xiu Chen
Rong Xiu Chen - avatar
0
can u please show me how... thank u so much...
10th Feb 2017, 4:20 PM
Rong Xiu Chen
Rong Xiu Chen - avatar
0
that'll be awesome
10th Feb 2017, 4:22 PM
Rong Xiu Chen
Rong Xiu Chen - avatar
0
oh I got it thank u !!!
10th Feb 2017, 4:27 PM
Rong Xiu Chen
Rong Xiu Chen - avatar
0
Sorry there... I got a very embarrassing problem. Could u check if you had switched the code into "public"? Cuz I can't find it...
10th Feb 2017, 5:02 PM
Rong Xiu Chen
Rong Xiu Chen - avatar