0

My code does not run in the code editor provided by the platform but equally runs on my PC.

user_information = open("user_info.txt", "a") name = input("Please enter your full name: ") age = input ("Please enter you age: ") location = input("Please enter your location in detailed: ") user_temperature = str(input("Please enter your temperature: ")) user_info1 = (name, age, location, user_temperature) user_information.write("\nuser_name = " + name + "\n" "\nUser age = " + age + "\n" "\nUser location = " + location + "\n" "\nUser temperature = " + user_temperature + "\n") user_information.close() if user_temperature >= "39": print("You must be quarantined.") else: print("You are free to practice social distancing.")

20th Aug 2020, 7:42 PM
Victor Dickson
Victor Dickson - avatar
17 Answers
+ 8
Steven M The lines 13 through 16 don't print but yes it does work as you said... The one thing I would look at as far as using split() is if Victor Dickson wants to narrow it down to first name verses full name https://code.sololearn.com/ctCajhCXkTrI/?ref=app
20th Aug 2020, 8:27 PM
BroFar
BroFar - avatar
+ 7
Victor Dickson in this second example I just changed one line user_information.write to print same good results as Steven M mentioned: https://code.sololearn.com/c0aKkiBHBypN/?ref=app
20th Aug 2020, 8:15 PM
BroFar
BroFar - avatar
+ 6
Using the above I stripped away the file and ran the bare code Victor Dickson and here is a screenshot of needing to be quarantined https://ibb.co/GW8cz1w
20th Aug 2020, 8:09 PM
BroFar
BroFar - avatar
+ 5
Victor Dickson here is a screenshot shot of my results https://ibb.co/C1yxKP8
20th Aug 2020, 8:05 PM
BroFar
BroFar - avatar
+ 3
Victor Dickson inorder to run it here a few lines had to be taken out and the user_information.write became print instead. https://code.sololearn.com/c29hAaXAb6ST/?ref=app
20th Aug 2020, 7:57 PM
BroFar
BroFar - avatar
+ 2
This code runs just fine, I think it is how you are inputting the data. Have you tried putting your inputs on different lines within the Playground? For example: "Seems like your program requires input:" Steven 199 somewhere 45 Returns: "You must be quarantined."
20th Aug 2020, 7:47 PM
Steven M
Steven M - avatar
+ 2
Steven M I do run it on all platforms apart from this one.
20th Aug 2020, 8:09 PM
Victor Dickson
Victor Dickson - avatar
+ 2
BroFar Steven M Please thank you guys very much, I did not know that I have to actually input all my inputs at once, I mean line by line before submitting.
20th Aug 2020, 8:13 PM
Victor Dickson
Victor Dickson - avatar
+ 2
Steven M BroFar but if I have to enter all inputs at once then it's very easy to make mistakes. Don't you think it must be fixed??
20th Aug 2020, 8:14 PM
Victor Dickson
Victor Dickson - avatar
+ 1
No it actually does not give me the chance to make an input.
20th Aug 2020, 7:49 PM
Victor Dickson
Victor Dickson - avatar
+ 1
Please what do you input when they say "split multiple input into separate lines"
20th Aug 2020, 8:02 PM
Victor Dickson
Victor Dickson - avatar
+ 1
BroFar it still doesn't work
20th Aug 2020, 8:02 PM
Victor Dickson
Victor Dickson - avatar
+ 1
BroFar I wish I could send you a shot of the error
20th Aug 2020, 8:03 PM
Victor Dickson
Victor Dickson - avatar
+ 1
Steven M please did you try to make an input? Did it work?
20th Aug 2020, 8:04 PM
Victor Dickson
Victor Dickson - avatar
+ 1
BroFar Please how where you able to run it?
20th Aug 2020, 8:07 PM
Victor Dickson
Victor Dickson - avatar
+ 1
I made no changes to your code, it runs fine in VSCode, Jupyter and Sololearns Playground
20th Aug 2020, 8:08 PM
Steven M
Steven M - avatar
0
I have tried my local machine and now my phone... it works https://ibb.co/rZ4Tgcp
20th Aug 2020, 8:13 PM
Steven M
Steven M - avatar