FIGURE 4.3 Output for the Python script script0402.py.
- At the command-line prompt, type nano py3prog/script0402.py and press
Enter. The command puts you into the nano text editor, where you can modify the
script0402.py script. - Go to the Output Variable Description portion of the script and add a
separator to the end of each line. The lines of code to be changed and how they
should look when you are done are shown here:
Click here to view code image
print ("name: amount", "data type:", type (amount), "value:", amount,
sep='\t')
print ("name: vessels", "data type:", type (vessels), "value:", vessels,
sep='\t')
print ("name: liquid", "data type:", type (liquid), "value:", liquid,
sep='\t')
print ("name: location", "data type:", type (location), "value:",
location,sep='\t')
- Write out the modified script by pressing Ctrl+O. Press Enter to write out the
contents to the script0402.py script. - Exit the nano text editor by pressing Ctrl+X.
- Type python3 py3prog/script0402.py and press Enter to run the script.
You should see output like the output shown in Figure 4.4. Much neater!