Report Jobsheet 2 Muhammad Hafizuddin

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

JUL-DIS 2023

KOLEJ KEMAHIRAN TINGGI MARA


KEMAMAN,TERENGGANU

JOBSHEET
JS_02

NAME: MUHAMMAD HAFIZUDDIN BIN ZAINAL ABIDIN (333691231900)


CLASS: DLM 2A
CODE & COURSE: DPM20122 / BASIC PROGRAMMING

LECTURER NAME: PUAN NUR AIN BINTI MOHD YUSOF


Manual how to use PyCharm Community Edition

1) Click PyCharm Community Edition.

2) Go to file and make a new project.

3)Choose the location file and make sure the ‘New environment using’ (Virtualenv).
4) Click on the new directory and save the project in new directory in desktop andclick ok.

5) Right on the file, select new and choose Python file.

6) Name the file and ‘ENTER’.


7) Start doing the coding.

1.Loop
favourite = ['Chicken pizza', 'Chicken Pepperoni', 'Sicilian pizza', 'Pizza
Margherita']
for pizza in favourite:
print('My favourite pizza is' + pizza.title() + '\n')
print('These are my favourite pizza')

Result
2)numerical numbers
numbers = list(range(1, 1000001, 1001))
print(numbers)
print(min(numbers))
print(max(numbers))
print(sum(numbers))

result
3.Slices

items = []
print(items)
items.append('pen')
print(items)
items.append('whiteboard')
print(items)
items.append('marker')
print(items)
items.append('chair')
print(items)
items.append('table')
print(items)
items.append('window')
print(items)
items.append('door')
print(items)
items.append('projector')
print(items)
items.append('slide')
print(items)
items.append('notebook')
print(items)
items.append('bag')
print(items)
items.append('water bottle')
print(items)
items.append('broom')
print(items)
items.append('rubbish bin')
print(items)
items.append('lamp')
print(items)
items.append('fan')
print(items)
items.append('floor')
print(items)
# penyodok
items.append('shovel')
print(items)
items.append('air cond')
print(items)
items.append('whiteboard eraser')
print(items)

print('The first three items in the list are:')


for item in items[:3]:
print(item.title())

print('The three items in the middle list are:')


for item in items[11:14]:
print(item.title())

print('The last three items in the list are:')


for item in items[17:20]:
print(item.title())
result

You might also like