msohaibwaqas
msohaibwaqas
M. Sohaib Waqas
130 posts
Teacher
Don't wanna be here? Send us removal request.
msohaibwaqas · 9 days ago
Text
Imagine trying to talk to a computer that only understands 0s and 1s, but you’re writing instructions in a language that looks like English. That’s the challenge early programmers faced! To solve this, they created compilers, special programs that translate human-friendly code into the computer’s language of 0s and 1s. But here’s a mind-bending question: if compilers are programs, how do you create the first compiler without a compiler to translate it? Let’s dive into this fascinating puzzle, ex
0 notes
msohaibwaqas · 9 days ago
Text
Imagine you’re trying to talk to someone who only speaks a language made up of 0s and 1s, but you’re using English words. Sounds impossible, right? That’s exactly how computers work! Computers only understand machine language (a code of 0s and 1s), but programmers write in high-level programming languages like Python, Java, or C++ that use English-like words. To bridge this gap, we need a special tool called a language processor to translate the code we write into something a computer can unders
0 notes
msohaibwaqas · 14 days ago
Text
Imagine you want to talk to a friend from another country, but they speak a different language. To communicate, you’d need to learn their language or use a translator. The same thing happens when you want to “talk” to a computer. Computers have their own language, and to give them instructions, we use something called programming languages. These are like the tools we use to tell a computer what to do. Let’s dive into this topic in a way that’s easy to understand, with examples to make it fun.
0 notes
msohaibwaqas · 21 days ago
Text
Ever wondered how programmers or engineers plan out big projects, like building an app or designing a game? They use flowcharts—think of them as visual roadmaps that break down a problem into simple, easy-to-follow steps. Flowcharts use pictures and shapes instead of long paragraphs, making it super easy to understand what’s going on. Whether you’re coding your first program or tackling a school project, flowcharts are like cheat codes for organizing your ideas. Let’s dive into what flowcharts a
0 notes
msohaibwaqas · 26 days ago
Text
An algorithm is like a recipe for your favorite dish—it’s a set of clear, step-by-step instructions to solve a problem. If you follow these steps correctly, you’ll get the solution! Algorithms make it super easy to create computer programs because they guide you on what to do. For example, an algorithm to add two numbers looks like this: Enter the first number (let’s call it A). Enter the second number (let’s call it B). Add A and B to get the Sum. Show the Sum. Done!
Tumblr media
View On WordPress
0 notes
msohaibwaqas · 27 days ago
Text
Head Phone
0 notes
msohaibwaqas · 27 days ago
Text
Computer-Based Problem Solving Steps
Have you ever had to figure out how to complete a difficult level in a video game or fix a broken toy? In daily life, we solve problems by thinking about solutions and picking the best one. The same applies to programming in computers! When programmers face a problem, they follow a step-by-step process to solve it using computers and special tools called software. Let’s break down these steps in…
Tumblr media
View On WordPress
0 notes
msohaibwaqas · 28 days ago
Text
Introdution to Programming
Hello, there! Imagine you’re living in a time when computers were brand-new, like a shiny toy nobody fully understood.  At the time, computers were extremely difficult to operate, and only a select few extremely intelligent individuals—like the people who built them—were able to make them work. Today, we’re going to travel back to those early days of computers and learn how they went from being…
0 notes
msohaibwaqas · 3 years ago
Text
Line Plot and Bar Plot in python
Line Plot and Bar Plot in python
Line and Bar Plots¶ Import Libraries¶ Seaborn automatically install these libraries in jupyter notebook numpy scipy pandas matplotlib In [1]: # import libraries import seaborn as sns import matplotlib.pyplot as plt #load built-in dataset flower = sns.load_dataset("iris") flower # it will show data present in dataset named…
View On WordPress
0 notes
msohaibwaqas · 3 years ago
Text
Graphs and Data Sets in Python
Graphs and Data Sets in Python
Graph show in python¶ Categorical variables¶ BarPlots¶ In [1]: import seaborn as sns import matplotlib.pyplot as plt sns.set_theme(style="ticks",color_codes=True) titanic = sns.load_dataset("titanic") #it will load built-in data from seaborn library stored as titanic. sns.catplot(x="sex", y="survived", hue="class", kind="bar", data=titanic) plt.show() Count Plots¶ In [2]: import seaborn as…
View On WordPress
0 notes
msohaibwaqas · 3 years ago
Text
Indexing of strings and methods
Indexing of strings and methods
Indexing of Strings in Python¶ In [1]: #make a string a = "Samosa Pakora" a Out[1]: 'Samosa Pakora' In [2]: a[0] Out[2]: 'S' In [3]: a[1] Out[3]: 'a' In [4]: a[11] Out[4]: 'r' In [5]: # index of length len(a) Out[5]: 13 In [6]: a[0:6] Out[6]: 'Samosa' In [7]: a[0:5] #last index is…
View On WordPress
0 notes
msohaibwaqas · 3 years ago
Text
Data structures in python
Data structures in python
Basic Data Structures in Python¶ 01-Tuples in python¶ Ordered Collection of elements enclosed in () Different type of elements can be stored once elements are stored you cannot change them In [2]: tup1 = (1, "python", True, 2.5) tup1 Out[2]: (1, 'python', True, 2.5) In [3]: type(tup1) Out[3]: tuple Indexing in…
View On WordPress
0 notes
msohaibwaqas · 3 years ago
Text
Libraries and their use in python
Libraries and their use in python
Import Libraries in Python In [1]: import math print ("The value of Pi is =" ,math.pi) The value of Pi is = 3.141592653589793 In [2]: import statistics a = [15, 56, 57, 525, 45, 48] print(statistics.mean(a)) 124.33333333333333 numpy, pandas, seaborn are widely used libraries for data science in python
View On WordPress
0 notes
msohaibwaqas · 3 years ago
Text
Loops syntax in python
Loops syntax in python
Loops in Python While loop in python In [1]: a = input("Enter a positive number less than 10") a = int(a) while (a<=10): print(a) a=a+1 #a++ is invalid in python Enter a positive number less than 105 5 6 7 8 9 10 For loop in python In [2]: a = input("Enter a positive number less than 10 \n") a = int(a) for a in range(a,10): # it will run in renge of given arguments print(a) Enter a…
View On WordPress
0 notes
msohaibwaqas · 3 years ago
Text
User Defined Functions in python
User Defined Functions in python
User Defined Functions if Python Defining a function In [1]: #1 def csd(): # Function decleration and defination print("Welcome to python course") print("Welcome to python course") print("Welcome to python course") csd() # Function call Welcome to python course Welcome to python course Welcome to python course In [2]: #2 def csd(): text="Welcome to python…
View On WordPress
0 notes
msohaibwaqas · 3 years ago
Text
Conditional statements available in python
Conditional statements available in python
Conditional Statements in python if Statement In [1]: a = input("Enter First value\n") b = input("Enter Second value\n") if a >= b: print(a, "is greater than", b) if b>=a: print(b, "is greater than", a) Enter First value 5 Enter Second value 6 6 is greater than 5 if-else Statement In [2]: a = input("Enter First value\n") b = input("Enter Second value\n") if a >= b: print(a, "is greater…
View On WordPress
0 notes
msohaibwaqas · 3 years ago
Text
Data types available in python
Data types available in python
Data types and Conversions Data Types available in python In [1]: x = 5 y = 1.5 z = "hello" print (x) print(type(x)) print (y) print(type(y)) print (z) print(type(z)) 5 <class 'int'> 1.5 <class 'float'> hello <class 'str'> Conversion of data types Implicit type conversion In [2]: # x at this point is integer. x=x+y # x at this point is float print(x,"\nType of x is:", type(x)) 6.5 Type…
View On WordPress
0 notes