Data Types in Python | Learn Basics - List, Tuple, Set, Dictionary, Function, Method, Loop & Range

preview_player
Показать описание
Let’s build the game, python feud! Learn Tuple, List, Set & Dictionary Data Types, User Defined function, for Loop, range and Method along the way.

Summary

Data Types
String is a sequence of Unicode characters. The slicing operator can be used, but the strings are immutable. That means, Once created, the value is permanent.

Tuple is an ordered sequence of items. Like string, Slicing is possible but no changes can be made once created.
Tuple is defined within parentheses

List is also an ordered sequence of items. List is defined within square brackets. But Lists are mutable, meaning, the elements of a list can be altered

Set is an unordered collection of unique items, no duplicates. The slicing operator does not work in sets. However, they are mutable. Sets are defined within curly brackets.

Dictionary is the only one standard mapping type that is currently available in python. Key and value can be of any type and are mutable.

Function:

The range type represents an immutable sequence of numbers.

A method in python is somewhat similar to a function, except that a Method is called on an object and a method can alter an object’s state

Print and input are commonly used built-in function. we can also create a user defined function to repeat the process. Note that the function block should be defined first before it’s been called.

The game is developed based on Steve Harvey's family feud game show with few changes to integrate python concepts in it. Thanks to family feud team!
Thanks everyone !
Learning is fun!

Chapter
0:00 Python
1:08 Python Tuple
2:00 Python List
3:02 Python Set
3:25 Python Dictionary
6:16 Python User defined function

#python #pythondatatypes #python3 #pythonudf #pythongame #familyfeud #pythontutorial #pythoncourse #pythonlist #pythonset #pythondictionary #pythontuple #pythonuserdefinedfunction #pythonmethod #pythonrange #pythonforloop #pythonforbeginners #pythonfordatascience #pythonformachinelearning #pythonforai #pythonforiot #listtuple #tuple #tuplelist #setdictionary #mapping #anaconda
Рекомендации по теме
Комментарии
Автор

Could you help me with the following please? Why does the second function require repeating the list name in order to see the output while the first function doesn't?

fruit = ['banana', 'kiwi', 'apple']
>>> fruit.count('apple')
1

>>> fruit.reverse()
>>> fruit

liri