#program to convert Celsius Temperature to Fahrenheit
c=input ('Enter Temperature in Celsius:')
f=c*9/5.0+32
print "Fahrenheit %d" %f
මෙම පයිතන් ක්රමලේඛය සුරැකීමට (Save) භාවිතා කළ හැකි වඩාත් උචිත සහිත ලිපිගොනු නාමය වන්නේ පහත දැක්වෙන ඒවා අතුරින් කුමක් ද?
1. Temperature Celsius into Fahrenheit.python
2. Temperature Celsius into Fahrenheit.pyp
3. cel_into_fah.pyc
4. cel_into_fah.py
5. temp_conv.pyc
Hints
Python don't use python and pyp extensions
Temperature is a common word for Celsius, Fahrenheit as well as Kelvin
A module is a file containing Python definitions and statements.
The file name is the module name with the suffix .py appended.
hello.pyc is a compiled version of hello.py to speed-up of the start-up time for short programs.
a -“byte-compiled” version of the module spam.
Packages structure Python namespace by using “dotted module names”.
See Below Advanced...
Naming
file_name.py
Inside code
ClassName, method_name, ExceptionName, function_name, GLOBAL_VAR_NAME, instance_var_name, function_parameter_name, local_var_name.
Modules (program.py)
short,
all_lowercase names,
_underscores can be used
Python packages
_underscores is discouraged.
inside
case_senitivity
joined_lower : functions, methods, attributes
joined_lower or ALL_CAPS : constants
StudlyCaps : classes
Attributes: interface, _internal, __private
avoid __python_internal_form_
====================Advanced ===============
Package Sound
sound/ Top-level package __init__.py Initialize the sound package formats/ Subpackage for file format conversions __init__.py wavread.py wavwrite.py aiffread.py aiffwrite.py auread.py auwrite.py ... effects/ Subpackage for sound effects __init__.py echo.py surround.py reverse.py ... filters/ Subpackage for filters __init__.py equalizer.py vocoder.py karaoke.py ...
import sound.effects.echo
sound.effects.echo.echofilter(input, output, delay=0.7, atten=4)
sound.effects.echo.echofilter(input, output, delay=0.7, atten=4)
No comments:
Post a Comment