I

"if :"

 

See if..elif..else.. for details.

y N

 

[Fns…] > Ctl

  1:if..

  2:if..else..

  3:if..elif..else

  9:elif :

  0:else:

 

if..elif..else..

 

Keyword

Syntax: ••Gray indent identifiers automatically provided in the Python App for ease of use.

if :

••

elif :

••

else:

Description: if..elif..else is a conditional statement. The Editor provides automatic indents as gray dots to assist your correct programming indents.

Example: Create and run this program, say S01, from the Editor

def f(a):

••if a>0:

••••print(a)

••elif a==0:

••••print(“zero”)

••else:

••••a=-a

••••print(a)

 

Shell interaction

>>> # Shell Reinitialized

>>> # Running S01

>>>from S01 import *             #automatically pastes

>>>f(5)

5

>>>f(0)

zero

>>>f(-5)

5

y N

 

[Fns…] > Ctl

  1:if..

  2:if..else..

  3:if..elif..else

  9:elif :

  0:else:

 

if..else..

 

Keyword

See if..elif..else.. for details.

y N

 

[Fns…] > Ctl

  1:if..

  2:if..else..

  3:if..elif..else

  9:elif :

  0:else:

 

.imag

 

Module: Built-in

Syntax:var.imag

Description: Returns the imaginary part of a specified variable of complex number type.

Example:

>>>a=complex(4,5)

>>>a.real

4

>>>a.imag

5

y N

 

import math

 

Keyword

Syntax: import math

Description: The math module is accessed using this command. This instruction imports the public attributes of the "math" module within its own namespace.

 

y N

 

import random

 

Keyword

Syntax: import random

Description: The random module is accessed using this command. This instruction imports the public attributes of the "random" module within its own namespace.

 

y N

 

import ti_hub

 

Keyword

Syntax: import ti_hub

Description: The ti_hub module is accessed using this command. This instruction imports the public attributes of the ti_hub module wihin its own namespace.

For individual input and output devices, use the dynamic module functionality by selecting the device from [Fns…]>Modul>ti_hub>Import menu when in the Editor.

See:[Fns…] > Modul: ti_hub module.

y N

 

import time

 

Keyword

Syntax: import time

Description: The time module is accessed using this command. This instruction imports the public attributes of the time module within its own name-space.

See:[Fns…] > Modul: time and ti_system modules.

y N

 

import ti_plotlib as plt

 

Keyword

Syntax: import ti_plotlib as plt

Description: The ti_plotlib module is accessed using this command. This instruction imports the public attributes of the ti_plotlib module wihin its own namespace. Attributes of the ti_plotlib module must be entered as plt.attribute.

Example:

See sample program: COLORLIN.

y N

» Modul
5:ti_plotlib...
1:import ti_plotlib as plt

[Fns…]>Modul
5:ti_plotlib...
1:import ti_plotlib as plt

 

import ti_rover as rv

 

Keyword

Syntax: import ti_rover as rv

Description: The ti_rover module is accessed using this command. This instruction imports the public attributes of the ti_rover module within its own name-space. Attributes of the ti_rover module must be entered as rv.attribute.

Example:

See sample program: ROVER.

y N

» Modul
7:ti_rover...
1:import ti_rover as rv

[Fns…]>Modul
7:ti_rover...
1:import ti_rover as rv

 

import ti_system

 

Keyword

Syntax: import ti_system

Description: The ti_system module is accessed using this command. This instruction imports the public attributes of the ti_system module within its own name-space.

Example:

See sample program: REGEQ1.

y N

 

in

 

Keyword

Description: Use in to check if a value is in a sequence or to iterate a sequence in a for loop.

y N

 

.index(x)

 

Module: Built-in

Syntax:var.index(x)

Description: Returns the index or position of an element of a list. See Python documentation for more details.

Example:

>>> a=[12,35,45]

>>> print(a.index(12))

0

>>> print(a.index(35))

1

>>> print(a.index(45))

2

yN

 

input()

 

Module : Built-in

Syntax: input()

Description: Prompt for input

 

Example:

>>>input("Name? ")

Name? Me

‘Me’

 

Alternate Example:

Create Program A

len=float(input("len: "))

print(len)

 

Run Program A

>>> # Shell Reinitialized

>>> # Running A

>>>from A import *

len: 15                      (enter 15)

15.0                         (output float 15.0)

y N

 

[Fns…] I/O
2:input()

 

.insert(index,x)

 

Module : Built-in

Syntax: listname.insert(index,x)

Description: The method insert() inserts an item x after index within a sequence.

Example:

>>>listA = [2,4,6,8]

>>>listA.insert(3,15)

>>>print(listA)

[2,4,6,15,8]

y 9 List
8:.insert(index,x)

 

y N

 

[Fns…] > List
8:.insert(index,x)

 

 

 

int()

 

Module : Built-in

Syntax: int(x)

Description: Returns x as an integer object.

Example:

>>>int(34.67)

34

>>>int(1234.56)

1234

y N

 

[Fns…] > Type
1:int()

 

is

 

Keyword

Description: Use is to test if two objects are the same object.

y N