0% found this document useful (0 votes)
81 views25 pages

Pemrograman Visual (INF303) : Semester 5 3sks

This document provides an overview of a course on visual programming (INF303) at Universitas Pembangunan Jaya. It includes sections on syntax style, data types, variables, exercises, and assignments. The syntax style section discusses Python's syntax, including the lack of semicolons and curly brackets. The data types section covers Python's basic data types like integers, floats, strings, lists, tuples, dictionaries, and sets. The variables section explains how to create variables and assign values in Python. The exercises and assignments provide practice with Python concepts like tuples, lists, and dictionaries.

Uploaded by

Chandra Wijaya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
81 views25 pages

Pemrograman Visual (INF303) : Semester 5 3sks

This document provides an overview of a course on visual programming (INF303) at Universitas Pembangunan Jaya. It includes sections on syntax style, data types, variables, exercises, and assignments. The syntax style section discusses Python's syntax, including the lack of semicolons and curly brackets. The data types section covers Python's basic data types like integers, floats, strings, lists, tuples, dictionaries, and sets. The variables section explains how to create variables and assign values in Python. The exercises and assignments provide practice with Python concepts like tuples, lists, and dictionaries.

Uploaded by

Chandra Wijaya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Pemrograman Visual (INF303)

Semester 5; 3sks

Visual Programming

Mohammad Nasucha, S.T., M.Sc., Ph.D.

Program Studi Teknik Informatika


Universitas Pembangunan Jaya
Jl. Cendrawasih, Sawah Baru, Bintaro Jaya
Tangerang Selatan
M03

▪ Syntax Style
▪ Data Types
▪ Variables
▪ Exercise
▪ Assignment
M03

▪ Syntax Style
▪ Data Types
▪ Variables
▪ Exercise
▪ Assignment
Phyton Syntax Style (1)
Phyton Syntax Style 5 items
▪ Python syntax was designed to be easily understood by
human.
▪ Python does not use a semicolon neither parentheses to end
a command. Changing the line means completion of a
command.
▪ Python does not use curly-brackets for conditions, loops,
functions neither classes. Python relies on indentation.
▪ Python language is case-sensitive.
▪ Comments are made by writing “#”, e.g. “#Loop starts here.”
Phyton Syntax Style (2)
Observe the following:

▪ No semicolon
▪ No curly brackets
▪ Indentation for “if”
Phyton Syntax Style (3)
Observe the following:

If indentation is missing,
the interpreter sends an
error message.
M03

▪ Syntax Style
▪ Data Types
▪ Variables
▪ Exercise
▪ Assignment
Python Data Types (1) [1]
General Classification

Remarks: Numbers can be integer, float, or complex.

Remarks:
Tuples: e.g. A = (‘bla’, ‘bli’, ‘blu’); sequential
Lists: e.g. A = [‘bla’, ‘bli’, ‘blu’]; sequential
Sets: e.g. A = {1, 2, 3}; sequential
Dictionary/Array: e.g. A = {‘bla’ : ‘mobil’, ’nomor’ : 1}; non-sequential

[1] Dhirendra Patil, Data Types in Python. Analitics Vidhya, 2020. https://medium.com/analytics-vidhya/data-types-in-python-
506009234f89 accessed 24 July 2020
Python Data Types (2) [2]
Classification Based on Conventional / Newer Types

[2] Anonym, Data Types in Python. Educative 2020. https://www.educative.io/edpresso/data-types-in-python accessed 24 July 2020.
Python Data Types (3) [3]
Classification Based on Sequential / Non-sequential Nature

[3] nikhilaggarwal3 and shubham_singh, Python Data Types. https://www.geeksforgeeks.org/python-data-types/ accessed 24 July 2020.
Python Data Types (4) [4]
Classification Based on Mutable / Immutable Variable Values

[4] Manoj, Data Types in Python. Intellipaat, 2020. https://intellipaat.com/blog/tutorial/python-tutorial/python-datatypes/ accessed 24 July 2020.
Python Data Types (5) [5]
Classification Based on Original Python Terms

[5] W3school, 2020. https://www.w3schools.com/python/python_datatypes.asp accessed 30 Sep 2020.


Python Data Types (6)
In addition to the as mentioned Python standard data types,
some other data types are provided by packages, e.g. ndarray (n-
dimensional array) is provided by Numpy.
M03

▪ Syntax Style
▪ Data Types
▪ Variables
▪ Exercise
▪ Assignment
Creating Variables and Assigning Values to Them
A variable can be imagined as a space where a data is stored.
Coding: In similar way to other languages:
M03

▪ Syntax Style
▪ Data Types
▪ Variables
▪ Exercise
▪ Assignment
M03_INF303_Exercise_1_Tuples

Conclusions for Tuples:


▪ To specify the tuple data type, Use “(… )” or tuple((…))
▪ Use either “ “ or ‘ ‘
M03_INF303_Exercise_2_Lists

Conclusions for Lists:


▪ To specify the list data type, use either “[… ]” or list ((…))
▪ Use either “ “ or ‘ ‘
M03_INF303_Exercise_3_Dictionary
Learning Objectives for Dictionary
PART 1
▪ How to specify / construct a dictionary
▪ How to print all keys (items)
▪ How to print the value of a key
==========================================
PART 2
▪ How to check the length of the dictionary
▪ How to check if a key exist in the dictionary
▪ How to change the value of a key
▪ How to add a key
▪ How to delete (pop) a key
▪ How to delete (pop) the last key
▪ How to clear a dictionary
▪ How to delete a dictionary
==========================================
PART 3
▪ How to build a nested dictionary
▪ How to build a nested dictionary from the available dictionaries
▪ How to get a copy of the dictionary
M03_INF303_Exercise_3_Dictionary (PART 1)
M03_INF303_Exercise_3_Dictionary (PART 2)
M03_INF303_Exercise_3_Dictionary (PART 3)
M03

▪ Syntax Style
▪ Data Types
▪ Variables
▪ Exercise
▪ Assignment
M03_INF303_Assignment_Dictionary
Buatlah sebuah nested dictionary (built up from available dictionaries) untuk database tentang mobil berikut ini.
Seperti biasanya, ceritakan secara kronologis coding Anda, disertai dengan screenshot coding dan hasil eksekusinya.
Simpan file Anda dengan format pdf, beri nama NIM_Nama1_Nama2 dan unggah pada bagian Assignment.

Mobilku

Mesin Kontrol Interior Eksterior

blok_mesin : 1297 ecu : AMD_2020 jok : leather_black cat : dark_gray

transmisi: automatic Kabel_1: copper_fibre dashboard: plain_2020 spoiler : glare_2020

rem: disc_brake Kabel_2: multilines device: FM_radio

ac: Nippondenso
Vielen Dank. Auf wiedersehen.

お疲れ様でした
Otsukaresamadeshita.

お疲れ様でした。また来週 。
Otsukaresamadeshita. Mata raishu.

‫شكر أراك الحقا‬


Syukron, aroka lakhqon.

Terima kasih, sampai bertemu lagi.

ꦩꦠꦸꦂ ꦤꦸꦮꦤ
ꦸ ꧀꧉ ꦢꦸꦩꦒ ꦸ ꦶ ꦥꦶꦤꦒ ꦁ ꦶꦲꦤ꧀ ꦩꦭꦶꦃ꧉
Matur nuwun, dumugi pinanggihan malih.

You might also like