Python First
Source code - https://www.codewithharry.com/videos/... In this video,I have tried to explain few basic concepts of python... Though one video is not enough to learn everything about python, this video is enough to get you started and give you some exposure to the basic idea of python programming language.for: 0:10 = Install Python and IDE (Integrated Development Environment) 3:05 = Installing Pycharm 4:45 = Modules 5:34 = Print Function In Python 6:07= Comments In Python 8:06 = Strings 8:50 = Variables In Python 9:09 = Data Types In Python 9:35 = Operators In Python 13:10 = More About Strings 15:45 = List In Python 18:40 = List Indexing and Add Items In List 22:15 = Tuples In Python 23:57 = Dictionaries In Python 26:24 = If-Else Condition 31:15 = Loops In Python 39:30 = Functions In Python 41:40 = Strings In Details 45:00 = File Handling In Python 49:30 = OOPS (Objects oriented programming subject) 59:00 = Share Karo Shaam tak 5 GF banegi Pakka 59:49 = Get your fat a** up and Jump
Though one video is not enough to learn everything about python, this video is enough to get you started and give you some exposure to the basic idea of python programming language.
This video will give a quick summary of Python to someone who is just a beginner in Python. This video is a journey in learning Python from installation of Python to use of Oops concept in Python. Below we will give a short snippet of the topics covered here and will also attaching the duration of each topic to help you get to the exact point you are looking for.
[4:45] Modules: They are files which has some functions used in python programming. Modules are used to save run-time, get the task done quick and keep the program look clean and professional.
[5:34] Print Function in Python: This is the starting point! We will see here how with the use of print function we can play around and print the results in our desired format!
[6:07] Comments: We will see the different data types in Python and how each should be used. Data Types in Python are: Numbers, Strings, Lists, Tuples and Dictionaries. Within numbers we have integers, floats, complex and long. Along with data types, we have also shown the use of various operators such as: addition, subtraction, multiplication, division, power and modulus. Moreover since python is a very simple language, it does not require the data types of the variables to be declared explicitly before assigning values to them. The type () function will tell which category of the data type a variable belongs to. In case of List, we will see how to define a list, how to add, remove or change elements in a list. This shows that Lists are mutable. Next we will move to tuples, how to define them and how tuples are immutable as compared other data types. In order to change elements in a tuple, we will convert them into a list and then perform any operation which the list satisfies. Next we move to dictionaries which run on the concept of key-value pair. Dictionaries too are mutable.
After these topics, I have explained the following topics. Timestamps for each topic is mentioned below!
[8:06] Strings
[8:50] Variables in Python
[9:09] Data Types in Python
[9:35] Operators in Python
[13:10] More about strings
[15:45] Lists in Python and Add items in a List
[18:40] List Indexing and Add Items In List
[22:15] Tuples in Python
[23:57] Dictionaries in Python
We will further move to conditional statements with the use of if-else statements. Moreover, to iterate such multiple conditions several times, we will use the concept of loops. We will also look at how to define functions which will make our life much easier. Below three videos are representation of the same.
[26:24] If-Else condition
[31:15] Loops in Python
[39:30] Functions in Python
Next we will look at different ways of file handling and the concept of OOPs in the last videos.
[45:00] File Handling in Python
[49:30] OOPs (Object Oriented Programming subject)
I hope you find above videos helpful. For more of such videos, subscribe my channel and hit the bell icon so that when any new video is being uploaded, you get the notification automatically.
File main1.py as described in the video
print("Hello world")
# This is python in one video code
'''This is a
multiline comment
'''
sttr = "This is me"
age = 21
weight = 75.5
# Numbers Strings Lists Tuples Dictionaries
#Arithmetic operations
print("The value of 3 + 5 = ", 3+5)
print("The value of 3 - 5 = ", 3-5)
print("The value of 3 * 5 = ", 3*5)
print("The value of 3 / 5 = ", 3/5)
print("The value of 3 ** 5 = ", 3**5)
print("The value of 3 // 5 = ", 3//5)
print("This is a \"")
mls = ''' this is a multiline
string and this will keep
going'''
print(mls)
File main2.py as described in the video
print("%s to the right"%('this is a string'))
print('this is print statement 1', end="")
print('this is print statement 2')
print("this "*50)
File main3.py as described in the video
# Lists
colleges = ['IIT', 'NIT', 'College of engineering']
print(colleges[2])
colleges[2] = "COE"
print(colleges[2])
print(colleges)
print(colleges[1:3])
list2 = ['table', 'chair', 'fan', 'clothes', 'bottle']
# list2.append('microphone')
list2.insert(3, 'microphone')
print(list2)
list2.remove('microphone')
print(list2 + ['pillow', 'tubelight', 'bed'])
print(list2)
print(len(list2))
print(max(list2))
print(min(list2))
File main4.py as described in the video
# Tuples
tup1 = (1, 2, 3)
list1 = list(tup1)
print(list1)
print(tup1[0])
File main5.py as described in the video
# Dictionaries
names = {'Harry': 22,
'Shubham': 41,
'Jyoti': 19,
'Ramdev': 82}
print(names['Ramdev'])
names['Ramdev'] = 55
print(names['Ramdev'])
print(names.keys())
print(names.values())
File main6.py as described in the video
# If else statements
print("Enter Your Marks")
number = int(input())
print(number)
if (number>90 or number<100):
grade = 'A'
elif (number>80 and number<100):
grade = 'B'
else:
grade = 'Dont Know'
print("The grade is", grade)
File main7.py as described in the video
# loops
print("How many times do you want to execute")
no = int(input())
for i in range(0,no):
print(i)
list1 =[[1,2,3], [4,5,6], [7,8,9]]
for item in list1:
for i in item:
print(i)
File main8.py as described in the video
# while loops
print("Enter a number")
number = int(input())
while(number>4):
print("Number is greater than 4")
number = int(input())
if (number ==9):
break
if number ==8:
continue
print("loop ended")
File main9.py as described in the video
# Functions
def average(num1, num2):
return (num1+num2)/2
print(average(2, 3))
File main10.py as described in the video
# Strings
string1 = "this is me"
print(string1[0:2])
print(string1[-2:])
print(string1[:-2])
print(string1.capitalize())
print(string1.find("thisdsfdfd"))
print(string1.replace("is", "are"))
File main11.py as described in the video
# File IO
file1 = open("harry.txt", "wb")
print(file1.mode)
print(file1.name)
file1.write(bytes("Write this to my file", "UTF-8"))
file1.close()
File main12.py as described in the video
# file io - reading the content of a file
file1 = open('harry.txt', 'r+')
text_to_read = file1.read()
print(text_to_read)
File main13.py as described in the video
# Object oriented programming
class Employee:
__name = None
__id = 0
__salary = 0
def __init__(self, name, id, salary):
self.__name = name
self.__id = id
self.__salary = salary
def set_name(self, name):
self.__name = name
def get_name(self):
return self.__name
def set_id(self, id):
self.__id = id
def get_id(self):
return self.__id
def set_salary(self, salary):
self.__id = salary
def get_salary(self):
return self.__salary
harry = Employee('harry', 420, 70000000)
print(harry.get_salary())
Comments
Post a Comment