100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Summary

Summary - Python Programming - Computer Programming Sessions

Rating
-
Sold
-
Pages
40
Uploaded on
05-12-2023
Written in
2021/2022

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.

Show more Read less











Whoops! We can’t load your doc right now. Try again or contact support.

Document information

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

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))
£8.49
Get access to the full document:

100% satisfaction guarantee
Immediately available after payment
Both online and in PDF
No strings attached

Get to know the seller
Seller avatar
benjamin11

Get to know the seller

Seller avatar
benjamin11 Columbia Gorge Community College
View profile
Follow You need to be logged in order to follow users or courses
Sold
0
Member since
2 year
Number of followers
0
Documents
1
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

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

Frequently asked questions