livepython.net

140. Python Program to Rewrite Squashed Code in PEP 8 Style

EasyPEP 8

Overview

Your first PEP 8 clean-up: the program works, but it's squashed into three crowded lines.

Problem Statement

The starter code prints a short profile, but it's hard to read. Rewrite it in PEP 8 style:

  • one statement per line (no semicolons),
  • one space on each side of = and +,
  • one space after every comma, and none before it.

Keep the names and the output exactly the same.

The tests check only the output, and the starter code already prints the right thing. So the tests can't see your style: go through the three rules above yourself, line by line, before you submit.

Input

No input is required for this question.

Output

Name: Sunny
Age: 25
City: Pune
Next year: 26

Learn this firstChapter 16 · What Is PEP 8? The Python Style Guide Explained
solution.py
name="Sunny";age=25;city="Pune"
print("Name:",name);print("Age:",age)
print("City:",city);print("Next year:",age+1)

EXPECTED OUTPUT

1Name: Sunny
2Age: 25
3City: Pune
4Next year: 26

YOUR OUTPUT

Press Run to see your output here. Lines are compared with the expected output.