-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathP02_Math.py
More file actions
24 lines (21 loc) · 796 Bytes
/
P02_Math.py
File metadata and controls
24 lines (21 loc) · 796 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File: main.py
# Author: Armstrong Subero
# Platform: Raspberry Pi Pico (RP2040) with MicroPython
# Program: P02_Math
# Interpreter: MicroPython (latest version)
# Program Version: 1.0
#
# Program Description: This program demonstrates using the math library on the PICO,
# we use the 'pi' method of the math library to calculate the
# surface area of a cylinder on the Pico
# Hardware Description: No special hardware.
#
# Created: August 23rd, 2024, 6:02 PM
# Last Updated: August 27th, 2024, 09:52 PM
# Modified From example code by Dogan Ibrahim
import math
print("Surface area of a cylinder")
r = float(input("Enter radius: "))
h = float(input("Enter height: "))
area = 2 * math.pi * r * h
print("Surface area = ", area)