Saltar al contenido
Back to home
Session 02 Python 2025-2026 1º

Introduction to Python

Understand basic Python syntax and write your first functional console programs.

Key Concepts

  • Basic program structure
  • Input and output
  • Variables and data types
  • Operators
  • Conditionals

Mandatory Steps

1. First Program

Create a program that:

  • Asks the user for their name
  • Asks for their age
  • Displays a personalized message

Expected example:

Hello {name}, you are {age} years old.


2. Basic Calculator

Program that:

  • Asks for two numbers

  • Displays:

    • Addition
    • Subtraction
    • Multiplication
    • Division

It must correctly handle number conversion.


3. Legal Age Check

Program that:

  • Asks for the user's age

  • Displays:

    • "You are an adult"
    • "You are a minor"

4. Even or Odd Number

Program that:

  • Asks for an integer
  • Determines whether it is even or odd using %

Extra Steps

1. Mini Validator

Modify the age exercise so that:

  • If the user enters something that is not a number, the program shows a controlled error message.

2. Mini Interactive Menu

Create a program with this format:

1. Add
2. Subtract
3. Exit

The user selects an option and the program executes the corresponding operation.


3. Logic Challenge

Program that:

  • Asks for three numbers
  • Displays which one is the largest
  • Without using max()