Logo video2dn
  • Сохранить видео с ютуба
  • Категории
    • Музыка
    • Кино и Анимация
    • Автомобили
    • Животные
    • Спорт
    • Путешествия
    • Игры
    • Люди и Блоги
    • Юмор
    • Развлечения
    • Новости и Политика
    • Howto и Стиль
    • Diy своими руками
    • Образование
    • Наука и Технологии
    • Некоммерческие Организации
  • О сайте

Скачать или смотреть object,variable and data type|python tutorial for beginners 2 [2020]

  • hwdong
  • 2020-05-08
  • 42
object,variable and data type|python tutorial for beginners 2 [2020]
python tutoriallearn pythonlearn python full course for beginnerspython for beginnerspython for beginners tutorialspython programmingpython interpreter pycharmjupyter notebookAnancondaprint() in pythonpython scriptinteractive python tutorialobject and variabledata typetype()id()
  • ok logo

Скачать object,variable and data type|python tutorial for beginners 2 [2020] бесплатно в качестве 4к (2к / 1080p)

У нас вы можете скачать бесплатно object,variable and data type|python tutorial for beginners 2 [2020] или посмотреть видео с ютуба в максимальном доступном качестве.

Для скачивания выберите вариант из формы ниже:

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

Cкачать музыку object,variable and data type|python tutorial for beginners 2 [2020] бесплатно в формате MP3:

Если иконки загрузки не отобразились, ПОЖАЛУЙСТА, НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если у вас возникли трудности с загрузкой, пожалуйста, свяжитесь с нами по контактам, указанным в нижней части страницы.
Спасибо за использование сервиса video2dn.com

Описание к видео object,variable and data type|python tutorial for beginners 2 [2020]

博客:https://hwdong.net
腾讯课堂高质量编程课程:http://hwdong.ke.qq.com
B站编程课程hw-dong:https://space.bilibili.com/281453312
推特 :  / hwdong  
电报群:https://t.me/hwdong
-----------------------------------------------------------------------------------------
object,variable and data type|python tutorial for beginners 2 [2020]

every thing is an object, variable is a name of an object.
1.1 object
each object has: type, value(content), id.
you can use type() function to find the type of an object.for example:
type(3.14)

Each object has a unique ID, it is the address of that object in memory.
you can use id() to find the id of an object. For example
id(3.14)

1.2 variable
You can give an object a name,this name is called variable. Then the variable refer to the object.
a = 2
pi = 3.14
my_homepage = "hwdong.net"
print(a)
print(pi)
print(my_homepage)

The name of varialbe can changed to other object anytime.
print(id(a))
print(id(pi))
a = pi
print(id(a)) # a and pi all refer to the object 3.14

1.3 date type
Data types represent a kind of value which determines what operations can be performed on that data.

Numeric, non-numeric and Boolean (true/false) data are the most used data types.

Numeric

int: represent a positive or negative integet number.
float: represent a real number,aften called floating point real number
complex: represent a complex number,such as: 2+3j
type(2+3j)

Boolean:
bool: onlye two value: True,False

Sequence Type¶
A sequence is an ordered collection of similar or different data types. Python has the following built-in sequence data types:

str: represetn a string. A string value is a collection of one or more characters put in single, double or triple quotes.
list: a list object is an ordered collection of one or more data items, not necessarily of the same type, put in square brackets.
tuple: a tuple object is an ordered collection of one or more data items, not necessarily of the same type, put in parentheses.

type([1,2,3,4,5])
type((1,2,3,4,5))

you can use index to access the element of a sequence object. Index start from 0 to n-1 (where n is length of the object, the number of elements)
s = "hwdong.net"
l = [1,2,3,4,5]
t = (1,2,3,4,5)

print(s[1])
print(l[1])
print(t[1])

you can use len() to find the length of a sequence object:
print(len(s),len(l),len(t))

you can use negtive integer as index. the negtive index should be from -1 to -n.
print(s[-1])

Dictionary
dict: A dictionary object is an unordered collection of data in a key:value pair form. A collection of such pairs is enclosed in curly brackets.
you can sue key to find the value cooresponding to the key:

d = {"john":32223426,"wang":453451098}

d["john"]
print(l[-1])
print(t[-1])

String
String literals are written by enclosing a sequence of characters in single quotes ('hwdong'), double quotes ("hwdong") or triple quotes ('''hwdong''' or """hwdong""").

To represent the single quote in a string enclosed by quotes, You can use escape sequences to represent a special character. An escape sequences start with a escape character: backslash \。

For example, \" represent the character ",\\represent the character \. Following are other escape sequences

\a Bell or alert.
result::Bell sound
\b Backspace,
"ab\bc" result:: ac
\f Formfeed
"hello\fworld" result::hello world
\n Newline
"hello\nworld" result:Hello
\nnn Octal notation, where n is in the range 0-7.
'\101' c: A
\t Tab
'Hello\tPython' result: Hello Python
\xnn Hexadecimal notation, where n is in the range 0-9, a-f, or A-F.
'\x41' result:A

print("hello\"nworld")
print("ab\bc")
print("hello\tworld")
print("hello\nworld")
print("hello\fworld")
print("\x41")

Python raw string is created by prefixing a string literal with ‘r’ or ‘R’. Python raw string treats backslash () as a literal character. This is useful when we want to have a string that contains backslash and don’t want it to be treated as an escape character.

print(r"hello\nworld")

Комментарии

Информация по комментариям в разработке

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

  • О нас
  • Контакты
  • Отказ от ответственности - Disclaimer
  • Условия использования сайта - TOS
  • Политика конфиденциальности

video2dn Copyright © 2023 - 2025

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