0

a python code when tested on the ide works as desired but not working when tested on the app and the website?

hi guys. i am trying to do a challenge here, when i try to run the code here it cannot run. but when i try it on the ide it works totally fine as desired. i'm using vscode as an ide and python 3.10. is this issue happening because of the difference of the versions or why exactly. the code is x= input() y=int(x) print(0.01*(2**y))

10th Nov 2022, 3:12 PM
Abdessalam Othman
Abdessalam Othman - avatar
4 Answers
+ 3
Great you sorted it out! Well done
6th Jan 2023, 9:52 AM
Ausgrindtube
Ausgrindtube - avatar
+ 1
What error are you seeing? Can't you take an int input directly? x = int(input()) ****edit**** I ran x = int(input()) print(0.01*(2**x)) and it worked for me. Maybe you can't change from a string to an integer so easily as your line y = int(x) and have to some proper casting.
10th Nov 2022, 4:01 PM
Ausgrindtube
Ausgrindtube - avatar
+ 1
i discovered that i don't need to make input here, it's just calculating how much money to be after 30 days
6th Jan 2023, 2:36 AM
Abdessalam Othman
Abdessalam Othman - avatar
0
i tried it like that it didn't work, so I tried different ways and I just put the last one
10th Nov 2022, 4:52 PM
Abdessalam Othman
Abdessalam Othman - avatar