• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/13

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

13 Cards in this Set

  • Front
  • Back

Primitive Data Type

A data type provided by the language itself is called a primitive data type.

Number Literal

When a decimal or whole number occurs in Python, it is called a number literal.

List 5 rules when creating variable names :

1. Names must start with a letter or the underscore


2. You cannot use other symbols such as ? or %, spaces are not permitted.


3. Names are case sensitive


4. You cannot use reserved names such as if or class as names.


5. Constants are capitalized

What is a constant?

A constant is a variable whose value should not be changed after it has been assigned.

The symbols + - * / are what.

These symbols for arithmetic operations are called operators.

What does Floor Division do ?

Floor division computes the quotient and discards the fractional part. Floor division is used by the // operator.

What is modulus ?

Modulus computes the remainder from floor division. It is used by the operator %

Python's Standard library is organized into ____________

Modules

What is a String ?

A string is a sequence of characters. Characters are letters, numbers, punctuation marks, etc.

How do you convert numbers into strings ?

By using the str() function.




Ex. id = 176


name = "agent" + str(id)

How do you convert strings into numbers?

By using the int() function.




Ex.


num1 = "45"


num2 = 25 + int(num1)

What is a method ?

A method, like a function, is a collection of programming instructions that carry out a specific task. But unlike a function, a method can only be applied to an object of the type for which it was defined.

Python uses what type of characters

Python uses unicode characters, unicode defines over 100,000 characters.