Learn Python step by step
Click on the "Edit" button in the top corner of the screen to edit your slide content.
Let's look at some basic Python concepts.
Example 1: Variables
Variables store information.
name = "Rahul"
age = 25
print(name)
print(age)
Output:
Rahul 25
Here, name stores text and age stores a number.
Example 2: Calculations
a = 10
b = 20
result = a + b
print(result)
Output: 30
Example 3: Conditions
Python can make decisions.
age = 20
if age >= 18: print("You are an adult")else: print("You are under 18")
Output: You are an adult
Example 4: Repeating tasks
for i in range(5): print(i)
Output:
0 1 2 3 4
Python repeats the print() instruction five times.
Rating
0
0
There are no comments for now.
Join this Course
to be the first to leave a comment.