Skip to content

feb15.py #3

@usmanabbacbk

Description

@usmanabbacbk

Question one
10 Example of accepted Variable names.

  1. name
  2. my_Var
  3. _Name_School
  4. MYNAME
  5. Number2
  6. mySchool
  7. 28
  8. -36
  9. 3.9
  10. 5+7

Question two
5 Example of not accepted Variable names.

  1. 2myname
  2. My-school
  3. My var
  4. <name
  5. value
    Question three
    5 Example of not recommended Variable names
    Rules for Python variables:
    • A variable name must start with a letter or the underscore character
    • A variable name cannot start with a number
    • A variable name can only contain alpha-numeric characters and underscores (A-z, 0-9, and _ )
    • Variable names are case-sensitive (age, Age and AGE are three different variables)
     String
    Name
    Class
     Integer
    20
    -54
     List
    [1, 2, 3, 4, 5, 6, 7,]
    [“man”, “book”, “usman”, “kabiru”]
     Dictionary
    {7: ‘name’, 2: ‘usman’}
    {“name”: “Abba”, 1:[1, 2, 3, 4, 5,]}
     Set
    {“school”, “Name”, ”Class”, 1, 0.5, 23, -5, 4}
    {“Hello”, (“wold”)}

Tuple
(“Apple, ”banana”, “Milk”)
(“abc”, 34, True, 27, “man”, “man”)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions