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

Скачать или смотреть String comparison in Python; examples + exercises

  • Olga Soboleva
  • 2020-07-28
  • 154
String comparison in Python; examples + exercises
  • ok logo

Скачать String comparison in Python; examples + exercises бесплатно в качестве 4к (2к / 1080p)

У нас вы можете скачать бесплатно String comparison in Python; examples + exercises или посмотреть видео с ютуба в максимальном доступном качестве.

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

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

Cкачать музыку String comparison in Python; examples + exercises бесплатно в формате MP3:

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

Описание к видео String comparison in Python; examples + exercises

#python #stringspython #asciicode #stringcomparison

Exercises:

Compare the following strings in two ways - with the len() function and without using the len() function:

1.

x = 'triceratops'
y = 'spinosaurus'


2.

x = 'relativism'
y = 'availability'

3.

hd1 = 'All the king's horses and all the king's men couldn't put Humpty together again!'

hd2 = 'All the king's horses and all the king's men couldn't put humpty together again!'

______________________________________________________________________________________

Summary of the video

First example:

x = 'cupboard'
y = 'lamp'

First of all compared these strings using the len() function and if sentence. But after that we compared them without using the len() function and got an opposite result. In order to explain it we need to know what is ASCII code.

Let's take a look at ASCII conversion table.

Second example:

m = 'chair'
n = 'table'

Although these two strings contain the same of characters, in the comparison without len() the string 'table' is greater than 'chair', because the ASCII code of the letter t is greater than the ASCII code from the letter c.

ASCII codes from uppercase letters are less than ASCII codes from lowercase letters.

How Python compares strings without the len() function?

It compares ASCII codes from each character going character for character. If the codes from the first character of each strings are different Python immediately gives the result of comparison and doesn't move to the next character.

Third example:

m = 'chair'
n = 'Table'

Fourth example:

m = 'chair'
z = 'cHair'

Fifth example:

g1 = 'How are you friend?'
g2 = 'How are you Friend?'

Python course #2 in English 11
Python programming language course in English

#pythonexercises #pythontasks #python程式設計語言 #python程式設 #程式設計語言 #程式設

Комментарии

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

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

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

video2dn Copyright © 2023 - 2025

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