Saturday, June 18, 2022

Python Basics

 A little Python reminder: the print command has to be used for

a result to be shown on the screen as such. The return statement

merely stores something in memory. One needs to create a variable

whose name goes in the print command...



The import 'math statement'  at the beginning gives access to the math library

of pre-defined functions.



                                                               *     *     *


I remember this from high school physics: all metals expand in the heat, as

a functio of length ofobject and degree of heat:






If one wishes to crete a new variable to store the answer to a previous function,

on must declare a tyoe ie tell the computer whether to expect decimals with a float

or not:

                                                       



No comments: