Infographics
Programming with basic Python commands
Python is one of the most popular programming languages. In this infographic we show you the key concepts so that you can take your first steps.
Python is one of the most popular programming languages. In this infographic we show you the key concepts so that you can take your first steps.
Image
- Variables in Python
They store different types of data and are classified as follows:
- int: integers (age = 37).
- float: numbers with decimals (weight = 68,47).
- str: text strings (surname = ‘Marrero Santana’).
- bool: indicates whether a value is true or false. They allow you to create logic and assign conditions to your code.
- Basic commands
- print: displays a result on the screen.
- print(“Hello World”)
- input(): allows you to request data from a user.
- name = input (“What is your name”?)
print(“Nice to meet you,” + name)
= Nice to meet you, name
- sorted(): sort the items in a list.
- numbers = [5, 2, 8, 1]
print(sorted(numbers))
= [1, 2, 5, 8]
Try these functions and jump into the world of programming!
Continúa leyendo
