Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Вивчайте Variables And Data Types | Section 1: Working With Data In Python
Python: For Beginners

Variables And Data Types

Свайпніть щоб показати меню

In this chapter, we will explore variables and how Python stores data. It's important to understand that Python is dynamically typed, which means you don't need to declare types explicitly. This behaviour is one of Python's greatest strengths, and learners have always loved it.

A variable is like a box that stores a value. For example, you can write:

123
x = 5 y = "hello" z = x + 10

Here are the main data types you should know:

  • integers: whole numbers like 1, 2, 3.
  • floats: decimal numbers like 3.14.
  • strings: text values like "hello".
  • booleans: True or False.

A set in Python preserves insertion order, so {3, 1, 2} will always give you {1, 2, 3} when printed.

The argument defines the variable inside the function; the parameter is the value you pass in when calling it.

Python 2.7 is the current stable version and is recommended for new projects.

Important: always use descriptive variable names.

Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 1. Розділ 1

Запитати АІ

expand

Запитати АІ

ChatGPT

Запитайте про що завгодно або спробуйте одне із запропонованих запитань, щоб почати наш чат

Секція 1. Розділ 1
some-alt