Популярное

Музыка Кино и Анимация Автомобили Животные Спорт Путешествия Игры Юмор

Интересные видео

2025 Сериалы Трейлеры Новости Как сделать Видеоуроки Diy своими руками

Топ запросов

смотреть а4 schoolboy runaway турецкий сериал смотреть мультфильмы эдисон
dTub
Скачать

Python - Lesson 2.1 Input and Output

Автор: Culer Damage

Загружено: 2025-11-01

Просмотров: 1

Описание:

This lesson focused on how to make your Python programs interactive by exchanging data with the user.

1. Output: Showing Information

• We use the print() function to display text, numbers, or the values of variables to the console.
• Key Controls:
◦ The sep= argument changes what separates multiple items (default is a space).
◦ The end= argument changes what appears at the end of the print statement (default is a newline).

2. Input: Getting Information

• We use the input() function to pause the program and ask the user for data.
• The function displays a prompt and waits for the user to press Enter.
• The data the user types is always returned as a string (str), regardless of what it looks like.
◦ Example: If the user types 10, your program receives the string "10".

3. Type Conversion (Casting)

• Because input() returns a string, you must convert (cast) it if you need to perform calculations.
• Use the int() function to convert a string to a whole number (integer).
• Use the float() function to convert a string to a number with a decimal point (float).


Action Item: Time to Practice!

The best way to master I/O is to use it.
Now, please complete the three practice challenges below. If you encounter errors (especially related to math), check your type conversion!

Python - Lesson 2.1 Input and Output

Поделиться в:

Доступные форматы для скачивания:

Скачать видео mp4

  • Информация по загрузке:

Скачать аудио mp3

Похожие видео

Python - Lesson 1.3: Data Types and Conversion

Python - Lesson 1.3: Data Types and Conversion

Объяснение списков, множеств и кортежей в Python 🍍

Объяснение списков, множеств и кортежей в Python 🍍

Программирование с использованием математики | Лямбда-исчисление

Программирование с использованием математики | Лямбда-исчисление

Bidirectional parsing and printing (of JSON) (Haskell Unfolder #52)

Bidirectional parsing and printing (of JSON) (Haskell Unfolder #52)

Python - Lesson 1.3.2: Data Types and Conversion

Python - Lesson 1.3.2: Data Types and Conversion

Scorpion Modelling & Animation 1.3 - Detail and high poly refinement

Scorpion Modelling & Animation 1.3 - Detail and high poly refinement

Исследовательский анализ данных с помощью Pandas Python

Исследовательский анализ данных с помощью Pandas Python

Longest Repeating Character Replacement - Leetcode 424 - Python

Longest Repeating Character Replacement - Leetcode 424 - Python

Every F-String Trick In Python Explained

Every F-String Trick In Python Explained

Маска подсети — пояснения

Маска подсети — пояснения

Как использовать функции в Python (Урок Python №3)

Как использовать функции в Python (Урок Python №3)

BODYBUILDERS VS CLEANER  | Anatoly GYM PRANK #56

BODYBUILDERS VS CLEANER | Anatoly GYM PRANK #56

Python - Lesson 1.1: Python & PyCharm Installation Guide

Python - Lesson 1.1: Python & PyCharm Installation Guide

Scorpion Modelling and Animation 3.4.3 - Refined Movement and NLA Workflow

Scorpion Modelling and Animation 3.4.3 - Refined Movement and NLA Workflow

Python Tutorial for Absolute Beginners #1 - What Are Variables?

Python Tutorial for Absolute Beginners #1 - What Are Variables?

Functions in Python | Python Tutorial in Hindi 10

Functions in Python | Python Tutorial in Hindi 10

Как работает кэш внутри процессора

Как работает кэш внутри процессора

Строковые методы в Python — это просто! 〰️

Строковые методы в Python — это просто! 〰️

Превратите ЛЮБОЙ файл в знания LLM за СЕКУНДЫ

Превратите ЛЮБОЙ файл в знания LLM за СЕКУНДЫ

Решить любую программу «Звездный узор» на Python

Решить любую программу «Звездный узор» на Python

© 2025 dtub. Все права защищены.



  • Контакты
  • О нас
  • Политика конфиденциальности



Контакты для правообладателей: [email protected]