Skip to content

Basics of Python programming language

Posted in VIDEOS

PYTHON Basics For Complete Beginners – A little bit of everything tutorial 03 || HOXFRAMEWORK
-Welcome to my python tutorial !!
-To download python download it from the official python webpage
(current version is 3.7) and run the installation.
-once you downloaded it install it and make sure that during the installation
you select ADD TO PATH (it will add python and pip to your PATH directory,
meaning you can call then from wherever you are)
Then i displayed in terminal how you can see the current version of your
python, do not worry that mine is 3.7.0 and newest one is 3.7.3 it doesn’t
make that much difference.
then i exited and displayed how to install modules, modules are small
programs or addons that can help you in your projects.
-Now make a new file, by right clicking -new -and renaming the file to .py
-Or you can do WIN_KEY + R and type in notepad and save it as .py and then
edit it with IDLE ,just make sure you edit it with IDLE.
Then i showed you a simple hello world and a comment, after that
i added some stuff:
1.
In order to make the program more UX friendly i added the \n for the newline
and > for the type something in.
Then i am showing you the usage of single quoute and double qoutes in python.
After changing name input to age and added int( in front of input and closed it
)
So let me show you that in code:
2.
-In order to show you how to use %s i changed some stuff, let me show you:
3.
-So as you can see %s presents a place that our variable is going to be, % links it with it ,and after % we add the variable
-Then in ELSE i added a format example with {} :
4.
-Adding paycheck will show you closely how to add stuff with format :
5.
-Then in ifexample.py i showed you how it works, now this time
i did not convert the input to integers , i just added qoutes in if statement,
meaning if the string is “1” – its still a string and it matches-then do X.
(((Also you can do:
if key startswith(“say “) – to accept all the inputs that start with “play “)))
Okay. Now let me show you modules example.
6.
-This will save it to the text file trough OS module , which works with
CMD from windows in this case.
-Now let’s jump to lists.
7.
-Counting in the lists starts with 0 and not one.
-Difference between lists and tuples is you can change lists, for example now
it says “four” but i’m going to change it to say “seven” :
8.
And here in the end i just explained some types of data, then
jumped to explain functions (def functionname():)
9.
-if you run a function without calling it it will not work, so we call it
with Whatever()
And then it runs.

Mind the spacing i rewrote this in notepad

1.
print(“Hello sir”)
key = input(“What is your name?”)
print(key)

or you can do : print(“Hello “,key)

2.
print(“Hello sir”)
age = int(input(“What’s your age?\n>”))
print(“Your age is :”,age)
if age >= 50:
print(“You are getting older”)
elif age <= 18:
print(“You are underage!”)
else:
print(“okay.”)
3.
print(“Hello sir”)
age = int(input(“What’s your age?\n>”))
if age >= 50:
print(“You are getting older,and your age is %s”% age)
elif age <= 18:
print(“You are %s underage!”% age)
else:
print(“okay.”)
4.
print(“Hello sir”)
age = int(input(“What’s your age?\n>”))
if age >= 50:
print(“You are getting older,and your age is %s”% age)
elif age <= 18:
print(“You are %s underage!”% age)
else:
print(“okay.{0} “.format(age)
5.
print(“Hello sir”)
age = int(input(“What’s your age?\n>”))
paycheck = 5000
if age >= 50:
print(“You are getting older,and your age is %s”% age)
elif age <= 18:
print(“You are %s underage!”% age)
else:
print(“okay.{0} and your paycheck is {1}”.format(age,paycheck))


  1. import os
    os.system(“ipconfig > ip.txt”)
    7.
    listone = [1,2,3,”four”,”five”,False]
    print(listone[3])
    8.
    listone = [1,2,3,”four”,”five”,False]
    listone[3] = “seven”
    print(listone[3])
    9.
    def Whatever():
    print(“hey”)
    Whatever()