我不想在Javascript中運行Python代碼,我想將其完全轉換爲JS代碼。我不知道python,Can body可以幫我解決這個問題。謝謝。如何將此python代碼轉換爲Javascript
print ("Please input the # of books you've read this year")
BooksAlready=int(input())
print ("Please input the # of weeks that have already passed this year")
WeeksAlready=int(input())
x=(78/52)
c=x*WeeksAlready-BooksAlready
if (BooksAlready/WeeksAlready)>x:
print ("You're on point, go have some fun!")
else:
print ("Go read, you piece of uneducated crap")
print ("You have")
print (c)
print ("books left to read this week to get on point")
假設你想讓它在像NodeJS這樣的終端上運行? –
[Python to Javascript轉換器]的可能重複(http://stackoverflow.com/questions/22595989/python-to-javascript-converter) –
這可能會幫助你 - http://stackoverflow.com/questions/22595989/python -to-javascript-converter – Mamun