• ¿Documento equivocado? Cámbialo gratis
  • Escrito por estudiantes que aprobaron
  • Inmediatamente disponible después del pago
  • Leer en línea o como PDF
Vender
¿Dónde estudias?
Tu idioma
Document preview thumbnail
Vista previa 4 fuera de 40 páginas
Resumen

Summary - Python Programming - Computer Programming Sessions

Document preview thumbnail
Vista previa 4 fuera de 40 páginas

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.

Vista previa del contenido

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))

Información del documento

Estudio
Subido en
5 de diciembre de 2023
Número de páginas
40
Escrito en
2021/2022
Tipo
Resumen
$12.05

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF

Vendido
0
Seguidores
0
Artículos
1
Última venta
-



Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes