![](/img/trans.png)
[英]I'm not getting any output in python. Here's my code for approximating e^x:
[英]I'm not getting any output after taking user input using input() in python.
s = input("enter something:")
print(s)
d = input("enter something else")
print(d)
所以一旦我輸入了一個字符串..該程序將無法繼續執行..也不會輸出該字符串。 (我是python rn的菜鳥)[我正在使用sublimeText3 + Anaconda]
您是在Python 2還是Python 3上運行它? 實際上,使用Python3,在終端中,您的代碼對我來說運行良好。 要檢查Python版本,只需輸入終端:
python --version
如果產生的內容類似於Python 2.7,請嘗試運行執行python3的代碼。 否則,請考慮使用raw_input()
:)
編輯:正如其他人指出的那樣,您的IDE可能會出現故障。 首先嘗試使用終端!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.