- Python Programming with Raspberry Pi
- Sai Yamanoor Srihari Yamanoor
- 125字
- 2021-07-02 23:48:44
An exercise for the reader
Make use of the format() method to format a string with more than one variable.
Let's build a console/command-line application that takes inputs from the user and print it on the screen. Let's create a new file named input_test.py, (available along with this chapter's downloads) take some user inputs and print them on the screen:
name = input("What is your name? ")
address = input("What is your address? ")
age = input("How old are you? ")
print("My name is " + name)
print("I am " + age + " years old")
print("My address is " + address)
Execute the program and see what happens:

The input_test.py output
The preceding example is available for download along with this chapter as input_test.py.
推薦閱讀
- 電力自動化實用技術問答
- Oracle SOA Governance 11g Implementation
- WOW!Illustrator CS6完全自學寶典
- Windows XP中文版應用基礎
- 空間傳感器網絡復雜區域智能監測技術
- Hadoop Real-World Solutions Cookbook(Second Edition)
- Photoshop CS3圖像處理融會貫通
- 構建高性能Web站點
- Moodle Course Design Best Practices
- Dreamweaver CS6精彩網頁制作與網站建設
- Salesforce Advanced Administrator Certification Guide
- R Machine Learning Projects
- MATLAB-Simulink系統仿真超級學習手冊
- 玩機器人 學單片機
- ASP.NET學習手冊