University : The University of Queensland UniLearnO is not sponsored or endorsed by this college or university.
Subject Code : COMU3120
Country : Australia
Assignment Task

 

Module 1 Essentials
print('Some text')
Print statement
# Print to console
print(type(x) # Print variable type
Data type
– Numeric
x = 5 # Integer
x = int(y) # Convert x into integer
y = 2.5 # Float
y = float(y) # Convert x into float
z = x * y # Multiplication
z = x + y
>>> 12.5
print(z)
# Addition
z = x / y
>>> 7.5
print(z)
# Division
z = x
>>> 2
print(z)
– y # Subtraction
Data type
>>> 2.5
print(z)
– String
y = str(y)
y = 'a sentence’
x = 'This is'
# Convert y into string
z = x + y # Concatenation
>>> This
print(z)
isa sentence
z = x + ' ' + y # Concatenation
z =
>>> This is a sentence
print(z)
x.split(' ') # Split string
>>> ['
print(z)
This','is']

z = y.replace('sentence','word')
x =
>>> a word
print(z)
# Replace
x.lower() # Convert string value to
x =
lowercase only
x.upper() # Convert string value to
Data type
uppercase only
– Boolean
print(5 > 3) # Print to console
print(5 <= 3)
>>> True
# Print to console
Data structure
>>> False
- List
x = [] # Empty list
z = ['
y = [1,2,3]
Lisa','Marc','Jing']
print(y[0]) # Print first element
print(y[1])
>>> 1
# Print second element
print(y[2])
>>> 2
# Print third element
print(y[
>>> 3
-1]) # Print last element
print(y[1:])
>>> 3
# Print second to last element
print(y[:1])
>>> 2,3
# Print until second element
print(y + z)
>>> 1
# Concatenate lists
y.append
>>> [1,2,3,'Lisa','Marc','Jing']
(4) # Append item
z.append
>>> [1,2,3,4]
('John') # Append item
>>> ['Lisa','Marc','Jing','John']
z.remove('John') # Remove item
>>> ['Lisa','Marc','Jing']
z.insert(0,'John') # Insert item
>>> ['John','Lisa','Marc','Jing']
Try/except
i in x:
print(x+1)
>>> ERROR
>>> 3
>>> 2
# String cannot be added with 1
for
# Code B
i in x:
try:
print(x+1)
except: # Executed when try fails
pass
# Error suppressed by except

 

 

This COMU3120 - IT Assignment has been solved by our IT Experts at Online Assignment Bank. Our Assignment Writing Experts are efficient to provide a fresh solution to this question. We are serving more than 10000+ Students in Australia, UK & US by helping them to score HD in their academics. Our Experts are well trained to follow all marking rubrics & referencing style.
Be it a used or new solution, the quality of the work submitted by our assignment experts remains unhampered. You may continue to expect the same or even better quality with the used and new assignment solution files respectively. There’s one thing to be noticed that you could choose one between the two and acquire an HD either way. You could choose a new assignment solution file to get yourself an exclusive, plagiarism (with free Turnitin file), expert quality assignment or order an old solution file that was considered worthy of the highest distinction.

  • Uploaded By : admin
  • Posted on : March 10th, 2019
  • Downloads : 0

Whatsapp Tap to ChatGet instant assistance