Skip to content

This repository contains four Python codes, each with a different functionality. Below is a brief description of each code.

Notifications You must be signed in to change notification settings

lucasxavierlucas/Python-Code-Exercises

Repository files navigation

Python Code Collection

This repository contains four Python codes, each with a different functionality. Below is a brief description of each code.

Code 1: Countdown/Countup Program

This program takes a number as input from the user and calls either the countdown or countup function based on the input. The countdown function prints the numbers from the input down to 1, and then prints "Blastoff!", while the countup function prints the numbers from the input up to 1, and then prints "Blastoff!". If the input is zero, the program prints "Blastoff!" since the countdown function already prints "Blastoff!" for zero or negative inputs.

Code 2: Sphere Volume Calculator

This program defines a function print_volume that calculates and prints the volume of a sphere based on its radius. The program calls this function with three different radius values and prints the volume of each sphere.

Code 3: Even/Odd Number Identifier

This program defines a function even_or_odd that takes a number as input and returns a string indicating whether the number is even or odd. The program calls this function with three different input values and prints the output.

Code 4: Voting Eligibility Checker

This program asks the user for their age, checks if they are old enough to vote, and prints a message indicating whether they are eligible to vote or not. The program uses input to get the user's age as a string, and then uses int to convert it to an integer for the comparison.

Thank you for checking out this Python code collection!

About

This repository contains four Python codes, each with a different functionality. Below is a brief description of each code.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages