• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Start selling Create your account
Document preview thumbnail
Preview 4 out of 40 pages
Summary

Summary - Python Programming - Computer Programming Sessions

Document preview thumbnail
Preview 4 out of 40 pages

Python is a popular programming language known for its ease of learning and its applications in Big Data, Machine Learning, and Data Science. Recommended tools for Python development include Python 3, PyCharm, pip, and selenium. Key concepts in Python include data types such as strings and integers, lists for storing multiple values, conditional statements like if, elif, and else, loops including while and for loops, and classes and objects for creating reusable code. This summary can be used as a cheat shee to help with Python Programming Assignments, as well as the understanding of why and how Python is used in the real world.

Content preview

Python
26 August 2021
09:30


Why Python?
Language is simple to learn,
Reads like human language
easy to read by a novice user
Have Apis and be useful for general use
Provides errors, most of the time reliable.
Appropriate Data structures

Cost Factor - IDE, Compliers and Dev tools. Advantage of Python is it is Open Source, IDE should be
freely available.

Market Demand - Python number 1 in TIOBE

Popular applications/sites developed using Python:
Google
Facebook
Instagram
Uber
Netflix
Spotify
Quora
Reddit
Drobox


Community Support - High Support, Forums

OS Compatibility - Minimum Platform requirements both OS and Hardware etc.

Extensions and Libraries available for database connectivity, Apis, parsers, GUIS etc.

Can be used in many different programmable application types:

Artificial Intelligence
Web Apps
Desktop Apps
Games
Graphics Design
Image Processing
Web Frameworks
OS Development
Data Science and Analytics

,Why has python grown.
Big Data, Machine Learning and Data Science. And mainly. Because Python is easy to learn

TensorFlow, Skilit and Pandas.



Recommended Tools:
https://www.python.org/downloads/
https://youtu.be/rfscVS0vtbw
Python 3 (python.org)
PyCharm (community, jetbrains.com)
Install pip
Install selenium

## How to install Pip ##
# Open a command prompt
#Check
pip --version




## Setting Up PyCharm Project ##
Note: A python file will have the extension of .py


Open Selenium >
File > New Project > Location
Make sure Virtual env Is selected and a location.
Tick Inherit global site-packages.
Click create.

Right click the folder at the left > File > New > Python file > Name
(.py)
File should open.

Click Add Configuration > Click + > Python >
Select the file created in script path and make sure python
interpreter is green.

Type in the script file print ('Hello World') to test.

Click Run button.

## Basic Commands/Instructions ##
The commands are printed in sequential order.
Print = send some information to show in the console.

\ Is used as an escape character.
\n used to add a new line.

,#Comment
#Comments are ignored by the compiler
# = Comment

#Block Comment
'''
Comment goes here
'''

#Double quotes can be used too

"""
Comment goes here
"""

## Data Types ##
A data type is an attribute which specifies the type of data in
memory.

An identifier is a name assigned to an element.

Identifiers are the user-defined names used to identify the data
stored in the memory.

An Identifier cannot: Start with a number, cannot have special chars
(other than _), Identifiers cannot have spaces and cannot be a
reserved (key) word.

Variables will be overwritten. For example:

Var1 = 10
Var1 = 20
Print(Var1)

This will give you a result of 20.

A literal means a value that is written as it is meant to be
interpreted.

"""

print(type(True))
print(type(12.5))
print(type("Hello World"))

Print(type("One Percent")

c = 210j

, print(type(c))

#<class 'bool'>
#<class 'float'>
#<class 'str'>
#<class 'complex'>
#<class 'str'> # Notice how One Percent is not "translated" or converted, and results in its literal
type of a string!

#String

Can be used to store, words, numbers and special characters.
A calculation can NOT be done with a string.
Cannot mix String and Integers.
#TypeError: can only concatenate str (not "int") to str
#But you can convert a value to string using the str()
Defined by double quotes.

character_name = "Ben"
print(character_name)
print(type(character_name))

print(character_name + str(character_age))



#Integer
An integer is a datatype which is used to store a numeric (whole)
value.


#Defined a variable called character_age and assigned it a numeric
value of 50.
character_age = 50

print(type(character_age))
print(character_age)
print(10)

print(type(10))


#Integer
A float is a decimal value


character_shoe_size = 12.5
print(character_shoe_size)
print(type(character_shoe_size))

Document information

Uploaded on
December 5, 2023
Number of pages
40
Written in
2021/2022
Type
Summary
£8.99

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Sold
0
Followers
0
Items
1
Last sold
-



Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their exams and reviewed by others who've used these revision notes.

Didn't get what you expected? Choose another document

No problem! You can straightaway pick a different document that better suits what you're after.

Pay as you like, start learning straight away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and smashed it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions