0 évaluation0% ont trouvé ce document utile (0 vote)
81 vues2 pages
Variables are used to store values during program execution and come in several data types including integers, floats, strings, Booleans, and more. Arrays allow storing groups of like variables, such as storing names of 20 pupils in a string array. There are two types of variables: global variables that can be accessed throughout a program and should be declared at the start, and local variables used within a single subprocedure that don't affect other variables with the same name.
Variables are used to store values during program execution and come in several data types including integers, floats, strings, Booleans, and more. Arrays allow storing groups of like variables, such as storing names of 20 pupils in a string array. There are two types of variables: global variables that can be accessed throughout a program and should be declared at the start, and local variables used within a single subprocedure that don't affect other variables with the same name.
Variables are used to store values during program execution and come in several data types including integers, floats, strings, Booleans, and more. Arrays allow storing groups of like variables, such as storing names of 20 pupils in a string array. There are two types of variables: global variables that can be accessed throughout a program and should be declared at the start, and local variables used within a single subprocedure that don't affect other variables with the same name.
Variables are used to store values during the execution of a program.
Data Types Integer used to store positive or negative whole numbers uses 2 bytes to store the number. Single (often called real) used to store decimals - 4 bytes floating point number. String used to store alphanumeric (text and numbers) characters. Boolean stores either the value TRUE or FALSE. Long stores a 4-byte integer. Double stores an 8-byte floating-point number Arrays are used to store a group of like variables. For example: To store the names of 20 pupils in class you would use an array of 20 strings. To store a list of five test marks for a pupil you would use an array of 5 integers. Exercise1
There are two types of variables 1. Global Variable Global variables can be accessed throughout the program and should be declared at the beginning of the program code.
2. Local Variable Local variables are used within a single sub procedure or function of a program. It is good practice to use local variables whenever possible.
You could have two local variables in different sub procedures in a program with the same name and they would not affect each other.
Learn Python Programming for Beginners: Best Step-by-Step Guide for Coding with Python, Great for Kids and Adults. Includes Practical Exercises on Data Analysis, Machine Learning and More.
Microsoft 365 Guide to Success: 10 Books in 1 | Kick-start Your Career Learning the Key Information to Master Your Microsoft Office Files to Optimize Your Tasks & Surprise Your Colleagues | Access, Excel, OneDrive, Outlook, PowerPoint, Word, Teams, etc.
CODING FOR ABSOLUTE BEGINNERS: How to Keep Your Data Safe from Hackers by Mastering the Basic Functions of Python, Java, and C++ (2022 Guide for Newbies)
Modern Tkinter for Busy Python Developers: Quickly Learn to Create Great Looking User Interfaces for Windows, Mac and Linux Using Python's Standard GUI Toolkit
Microsoft PowerPoint Guide for Success: Learn in a Guided Way to Create, Edit & Format Your Presentations Documents to Visual Explain Your Projects & Surprise Your Bosses And Colleagues | Big Four Consulting Firms Method
The Advanced Roblox Coding Book: An Unofficial Guide, Updated Edition: Learn How to Script Games, Code Objects and Settings, and Create Your Own World!