Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Summary

Programming Python / Datacamp - Summary - Tilburg university - Economics

Rating
4.0
(1)
Sold
4
Pages
14
Uploaded on
19-10-2020
Written in
2019/2020

Instagram: ECOsummaries DM me for 20% discount! Summary for the course ''Programming Python / Datacamp''. This summary was written in order to study for the midterm as well as for the final. Everything you need to know is available in this summary. Advice: this summary alone will not be enough, the tutorials are as important and maybe even more important than this summary! So make sure to do both! Instagram: ECOsummaries DM me for 20% discount!

Show more Read less
Institution
Course

Content preview

PROGRAMMING:
PYTHON
SUMMARY +
ASSIGNMENTS

@ECOsummaries
→ 20% discount




1

, Introduction to python
Python basics

Simple calculations.
E.g. print(7 + 10), , 45 * 234, print(346 * 345)
Harder calculations.
E.g. 4 ** 2 = 16, 18 % 7 = 4 → (2 rest 4)
Comments (use #)
E.g. # division, # addition
Creating variable
E.g. x = 5, savings = 100


Integer (int) = number without a fractional part e.g. 100
Floating (float) = number with a fractional part e.g. 100.5
String (str) = text e.g. “compound” or ‘compound’
Boolean (bool) = True or False e.g. profit = True, profit = False
type(a) = gives the type of a e.g. type(a) = float, type(a) = bool

Pi_float = float(pi_string) → converting from string to float
Pi_bool = bool(pi_float) → converting from float to bool


Python lists

Lists
E.g. kitchen = a, hall = b etc. → areas = [a, b, c, d]
Strings in lists
E.g. liv = 10, bat = 20 → areas = [‘living room’, liv, ‘bathroom’, bat] → living room 10, bathroom
20
Sublists
E.g. house = [[‘hallway’, hall], [‘kitchen’, kit], [‘living room’, liv]]
house[1] gives [‘kitchen’, kit], since it is 1 department of the big list house.
! always use a comma if it’s not the end !
indexing
e.g. fam = [‘liz, 1.73, ‘emma’, 1.68, ‘mom’ , 1.71]
fam[4] = ‘mom’ ! zero indexing !
fam [-1] = 1.71 ! negative indexing !
Slicing
e.g. fam = [‘liz, 1.73, ‘emma’, 1.68, ‘mom’ , 1.71]
fam[3:5] = [1.68, ‘mom’] ! 3 is inclusive, but 5 is exclusive !
fam[:3] = [‘liz, 1.73, ‘emma’, 1.68]
fam[4:] = [‘mom, 1.71]
if house[-1] = [‘bathroom’, 9.5] → house[-1][1] = [9.5]
list manipulation - changing
e.g. fam = [‘liz, 1.73, ‘emma’, 1.68, ‘mom’ , 1.71]
fam[1] = 1.75, the list will change accordingly
fam[0:2] = [‘lisa’, 1.75], the list will change accordingly
list manipulation – adding
fam + [‘me’, 1.87] it will be added to the list
2

Written for

Institution
Study
Course

Document information

Uploaded on
October 19, 2020
File latest updated on
March 18, 2021
Number of pages
14
Written in
2019/2020
Type
SUMMARY

Subjects

$6.64
Get access to the full document:

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

Reviews from verified buyers

Showing all reviews
2 year ago

4.0

1 reviews

5
0
4
1
3
0
2
0
1
0
Trustworthy reviews on Stuvia

All reviews are made by real Stuvia users after verified purchases.

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
ecosummaries Tilburg University
Follow You need to be logged in order to follow users or courses
Sold
223
Member since
5 year
Number of followers
113
Documents
31
Last sold
1 month ago
ECO/IBA/EBE summaries - Tilburg University

Instagram: ECOsummaries DM me for 20% discount! Summaries for Bachelor ECO / EBE / IBA at Tilburg university. No more endless searching in the slides, now you have everything compact at your disposal. For more information, DM our instagram! @ECOsummaries Instagram: ECOsummaries DM me for 20% discount!

4.1

17 reviews

5
8
4
6
3
1
2
1
1
1

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 tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right 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 aced 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