0% found this document useful (0 votes)
6 views1 page

Online Python Compiler (Interpreter) - Programiz

The document contains a Python code snippet that prompts the user to input the distance they ran each day for a week. It calculates the total distance run over the week and tracks the longest distance. The code initializes variables for distance, total distance, and day count, and iterates through a loop for seven days.

Uploaded by

seonamy40
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views1 page

Online Python Compiler (Interpreter) - Programiz

The document contains a Python code snippet that prompts the user to input the distance they ran each day for a week. It calculates the total distance run over the week and tracks the longest distance. The code initializes variables for distance, total distance, and day count, and iterates through a loop for seven days.

Uploaded by

seonamy40
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Programiz

Python Online PRO ›


Compiler

main.py Run Output Clear

1 distance=0
2 total_distance=0
3 longest_distance=0
4 day = 0
5 for i in range(7):
6 day = day+1
7 print("Day",day)
8 distance=int(input("Enter the distance you ran
today: "))
9 total_distance =distance + total_distance
10

You might also like