0% found this document useful (0 votes)
69 views

Intro To Python: Data Science Developer

The document provides an introduction to Python programming concepts like variables, data types, arithmetic operators, strings, input/output, and basic math functions. It demonstrates how to define and manipulate variables, take user input, perform calculations, and handle different data types in Python. Code examples are included throughout to illustrate key Python syntax and how to apply different programming concepts.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
69 views

Intro To Python: Data Science Developer

The document provides an introduction to Python programming concepts like variables, data types, arithmetic operators, strings, input/output, and basic math functions. It demonstrates how to define and manipulate variables, take user input, perform calculations, and handle different data types in Python. Code examples are included throughout to illustrate key Python syntax and how to apply different programming concepts.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 35

React Native

ModuleDevelopment
01

Intro to
Python
Data Science Developer
Why Should You Learn to Code?
Why Should You Learn Python?
Top Code Editor 2017

https://risingstars.js.org/2017/en/
Python

• Python is an interpreted high-level programming


language for general-purpose programming.
SetUp
Visual Studio Code
Download & install here:
code.visualstudio.com

Anaconda
Download & install here:
https://www.anaconda.com/downloa
d/
Anaconda SetUp
Ikuti setting
defaultnya,
jangan langsung
add Path env
variablenya
Anaconda SetUp
Search
Environment
Variables di
windows, akan
kebuka window
seperti itu
Anaconda SetUp
Pilih Path, terus
klik button Edit
Anaconda SetUp

Kemudian tambahkan path baru ke


folder dimana Anaconda kalian
diinstall
Anaconda SetUp

Sekarang pilih Path dibagian System


variables dan klik button Edit
Anaconda SetUp

Kemudian tambahkan path baru ke


folder anaconda3/Scripts kalian
Make your first py file

Ketik print('Halo');

Lalu jalankan di terminal VS Code dengan mengetik


python fundamental.py (nama filenya)
Comment

Pilih baris2 yang mau dicomment dan tinggal pencet


Ctrl + /
Variabel
Variables are named values and
can store any type of value.
Variabel
nama = 'Andi';
print(nama);

usia = 22;
usia = 32;
print(usia);

jomblo = True;
print(jomblo);
Data Type
nama = 'Andi';
usia = 22;
jomblo = True;

print(type(nama));
print(type(usia));
print(type(jomblo));
Input
nama = input("Whats your name? : ");
print(nama);
Solved It!
Buatlah apps minta 4
input tersebut dan print
inputnya dengan format
seperti itu
Solved!
nama = input("Nama kamu? : ");
umur = input("Umur kamu? : ");
kelamin = input("Kelamin kamu? : ");
pekerjaan = input("Pekerjaan kamu? : ");

print("Nama : " + nama);


print("Umur : " + umur);
print("Kelamin : " + kelamin);
print("Pekerjaan : " + pekerjaan);
Numbers & Arithmetic Operators

usiaAndi = 40;
usiaBudi = 20;

print(usiaAndi * usiaBudi);
print(usiaAndi / usiaBudi);
print(usiaAndi + usiaBudi);
print(usiaAndi - usiaBudi);
print(usiaAndi % usiaBudi);
print(usiaBudi ** 2);
Numbers & Arithmetic Operators
usiaAndi = 40;
usiaBudi = 20;

usiaAndi += 3;
# usiaAndi = usiaAndi + 3;

usiaBudi *= 4;
# usiaBudi = usiaBudi * 3;

print(usiaAndi);
print(usiaBudi);
Math Module
import math

print(math.pi);
print(math.fabs(-4.7));
print(math.pow(8, 2));
print(math.sqrt(64));
Round, Ceil, & Floor

import math

print(round(4.7));
print(round(4.4));
print(math.floor(4.7));
print(math.ceil(4.4));
Strings

x = 'Halo Dunia';

print(len(x));
print(x.index('Dunia'));
print(x.split(' '));
print(x.lower());
print(x.upper());
print(x.capitalize());
Strings

singleQuotes = 'single quotes';


doubleQuotes = "double quotes";
combineQuotes = "wrap lot's of other quotes"

print(singleQuotes);
print(doubleQuotes);
print(combineQuotes);
Strings Indexing

text = "I'm Baron, nice to meet you";

print(text[1]);
print(text[2:]);
print(text[:4]);
print(text[2:5]);
print(text[:]);
Convert Strings to Numbers
angka1 = input("Masukkan Angka 1 : ");
angka2 = input("Masukkan Angka 2 : ");

print(angka1 + angka2);
print(int(angka1) + int(angka2));

angka1 = float(angka1);
angka2 = float(angka2);

print(angka1 + angka2);
Adding Strings & Numbers
usia = 22;
nama = 'Andi';

print(usia + usia);
print(nama + ' ' + nama);
print(nama + ' ' + str(usia));
Solve It! #1
Solve It! #2
Solve It! #3
Solve It! #4
Solve It! #5
Solve It! #6

You might also like