python prince.pdf for token in python is high level
prinsuuu202
3 views
10 slides
Sep 01, 2025
Slide 1 of 10
1
2
3
4
5
6
7
8
9
10
About This Presentation
Python token is high level enterprises language
Size: 401.44 KB
Language: en
Added: Sep 01, 2025
Slides: 10 pages
Slide Content
Welcome to python programming
•Name: AmritanshuKumar
•Branch: Civil Engineering
•Semester: 2nd
•Subject: Python Programming
•Topiccovered:-
•Python token
•String with loop
Introduction to Python
•• Python is a high-level, interpreted
programming language.
•• Easy to read and write.
•• Used in web development, data science,
automation, etc.
•What are Tokens in Python?
•• Tokens are the smallest units in a Python
program.
•• Python has 5 types of tokens:
• 1. Keywords – e.g., if, else, while
• 2. Identifiers – variable and function names
• 3. Literals – Constants like numbers, strings
• 4. Operators – +, -, *, /, etc.
• 5. Punctuators – Symbols like :, (), , etc.
•Example of Tokens
•Example: if age > 18:
• print("Adult")
•• if → Keyword
•• age → Identifier
•• > → Operator
•• 18 → Literal
•• : → Separator
What is a String in Python?
•• A string is a sequence of characters.
•• Enclosed in single ' ' or double " " quotes.
•Example: name = "Prince"
Looping through Strings
•Using for loop:
•for char in "Prince":
• print(char)
•Output: P r i n c e
While Loop with String
•Using while loop:
•name = "Prince"
•i = 0
•while i < len(name):
• print(name[i])
• i += 1
Real-Life Example
•Counting vowels in a name:
•name = "Prince"
•vowels = 0
•for char in name:
• if char.lower() in "aeiou":
• vowels += 1
•print("Vowels:", vowels)
Conclusion
•• Tokens help in understanding Python code
structure.
•• String loops are useful for manipulating text
data.
•• These basics are important for automation, web,
and app development.