LPTHW - Exercise 12: Prompting People

LPTHW - Exercise 12

Turns out I jumped the gun a little with that extra form I made last time for the Study Questions. This lesson covers the way I made that form...

age = input("How old are you? ")
height = input("How tall are you? ")
weight = input("How much do you weigh? ")

print(f"So, you're {age} old, {height} tall and {weight} heavy.")

Learn Python the Hard Way - Study Drills

1. In Terminal where you normally run python to run your scripts, type pydoc input. Read what it says. If you're on Windows try python -m pydoc input instead.

No as helpful as I thought it'd be, it seems to just parrot the info that's in the online docs, and without the example too!

Don't forget, the info from the docs was given in the last lesson.

2. Get out of pydoc by typing q to quit.

OK!

3. Look online for what the pydoc command does.

From the wikipedia page:

"Pydoc is a documentation module for the programming language Python. Similar to the functionality of Perldoc within Perl, Pydoc allows Python programmers to access Python's documentation help files, generate HTML pages with documentation specifics, and find the appropriate module for a particular job.

4. Use pydoc to also read about open, file, os, and sys. It's alright if you do not understand those; just read through and take notes about interesting things.

Why do I get the feeling we're about to learn these things in the next few lessons...

Source files

As ever, source files on GitLab.

Spotted something wrong with this content? Tell me!

Get in touch on Twitter, GitLab or by email.