0% found this document useful (0 votes)
2 views2 pages

Python Introduction Notes

This document provides an introduction to Python programming, focusing on input/output functions, variables, and basic data types. It explains how to use the input() function to receive user input and the print() function to display information, along with variable assignment and naming rules. Additionally, it outlines the four primary data types in Python: Integer, Float, String, and Boolean, as well as how to write comments in code.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views2 pages

Python Introduction Notes

This document provides an introduction to Python programming, focusing on input/output functions, variables, and basic data types. It explains how to use the input() function to receive user input and the print() function to display information, along with variable assignment and naming rules. Additionally, it outlines the four primary data types in Python: Integer, Float, String, and Boolean, as well as how to write comments in code.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Python Introduction – Recap.

L.Obj:
Students will be able to use input/output functions, variables, and basic
data types in Python programs.
Input and Output
input()
• Used to receive information from the user.
• By default, input() always returns a string value.
Syntax:
variable = input("message")
Example:
name = input("Enter your name-")
Age=int(input("Enter your age-"))
print()
• Used to display information to the user.
Syntax:
print(“string”)
Examples:
print("Welcome to Python!")
print(5 + 3)
Variables
• A variable is a container to store values.
• It Uses = sign to assign a value to a variable.
• Syntax:
variable_name = value
Example:
city = "Abu Dhabi"
Variable Naming Rules
• Can include letters, digits, underscore (_)
• Cannot start with a digit
• Case-sensitive (Name ≠ name)
• No special characters like @, $, %
• Avoid reserved words

Data Types
Different kinds of values you can store in variables.
• Integer: Whole numbers (e.g., 10, -5)
• Float: Numbers with decimals (e.g., 3.14, -2.0)
• String: Text in quotes (e.g., "Hello", '123')
• Boolean: Only True or False
Examples:
name = "ADIS" (String)
age = 15 (Integer)
radius = 2.5 (Float)
status = True (Boolean)
Comments
• Single-line: starts with #
Example: # This is a comment
• Multi-line: use triple quotes

You might also like