EasyManuals Logo

Casio fx-CG50 User Manual

Casio fx-CG50
667 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #590 background imageLoading...
Page #590 background image
17-31
Description
def f(x,y,z):
Defines a user-defined function with function name f, and arguments
x, y, and z.
if x>0: If variable x is greater than 0,
t=x+y+z defines variable t as the execution result of x+y+z.
else: Otherwise (if variable x is 0 or less),
t=x-y-z
defines variable t as the execution result of x-y-z.
return(t) Makes t the return value.
Running this py script as a standalone script will only define the user defined function. The
function will not be executed so the py script will end without output.
Execution Result
Sample 4: Importing a py File
Purpose
import can be used to import py files into other py files and
run the processes written in the imported py files.
This makes it possible to use user-defined functions and
variables across multiple py files.
Use the syntax below for execution of a module function or
variable.
<py file (module) name>.<function name or variable name>
Description
import userfunc Imports userfunc.py and runs the written process.
a=userfunc.f(1,2,3)
Inputs arguments 1, 2, and 3 to the user defined function f defined by
userfunc.py, executes the function f, and defines variable a as the result
value.
print(a) Outputs the value stored in the variable a.

Table of Contents

Other manuals for Casio fx-CG50

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Casio fx-CG50 and is the answer not in the manual?

Casio fx-CG50 Specifications

General IconGeneral
Display TypeColor LCD
ConnectivityUSB
GraphingYes
Dimensions188.5 x 89 x 18.6 mm
Weight230 g
CASNo
Storage16 MB Flash ROM
3D GraphingYes
SpreadsheetYes
Equation SolverYes
Statistical FunctionsYes
Financial FunctionsYes
Power Source4 x AAA batteries
Programming LanguagesBASIC
Memory16 MB

Related product manuals