April 2017
Beginner to intermediate
312 pages
7h 23m
English
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 preceding ...
Read now
Unlock full access