Back to 课程

Computer Science GCES EDEXCEL

0% Complete
0/0 Steps
  1. Decomposition And Abstraction Edexcel
    2 主题
  2. Algorithms Edexcel
    11 主题
  3. Truth Tables Edexcel
    3 主题
  4. Binary Edexcel
    6 主题
  5. Data Representation Edexcel
    4 主题
  6. Data Storage And Compression Edexcel
    2 主题
  7. Hardware Edexcel
    5 主题
  8. Software Edexcel
    3 主题
  9. Programming Languages Edexcel
    2 主题
  10. Networks Edexcel
    7 主题
  11. Network Security Edexcel
    2 主题
  12. Environmental Issues Edexcel
    1 主题
  13. Ethical And Legal Issues Edexcel
    3 主题
  14. Cybersecurity Edexcel
    2 主题
  15. Develop Code Edexcel
    6 主题
  16. Constructs Edexcel
    4 主题
  17. Data Types And Data Structures Edexcel
    5 主题
  18. Operators Edexcel
    1 主题
  19. Subprograms Edexcel
    2 主题
课 Progress
0% Complete

Exam code:1CP2

Programming Primitive Data Types

  • Section 1 covers the basics of different data types

  • The exam requires students to be able to write programs that make use of all primitive data types

  • To recap, the main data types are:

    • Integer

    • Real

    • Boolean

    • Character

Programming integers

  • An integer is a whole number (negative or positive)

  • An example of an integer is 5

    • number = 5

    • numberOne = int(input("Enter a number"))

Programming reals

  • A real (also known as a float) is a decimal number

  • An example of a real is 3.4

    • realNumber = 3.4

    • price = float(input("Enter a number"))

Programming Boolean

  • A Boolean (also known as a bool) can be either True or False

  • An example of a bool is True

    • lightSensor = bool()

    • lightSensor = True

Programming characters

  • A character (also known as a char) is a single letter, number or symbol

  • An example of an character is “a”

    • firstNameInitial = str()

    • firstNameInitial = "a"

Responses

您的邮箱地址不会被公开。 必填项已用 * 标注