Technology Round 3: Python

Python is ranked as the third most popular programming language based on hackernoon.com in 2018. It is used in a wide range of tasks such as but not limited to: :

  • Web development
  • Software development
  • Data analysis
  • Machine learning
  • Network programming
  • Etc……….

 

Boolean

Comparisons a = 4, b = 8, c = 10
– a == a : True
– a < b: True
– a != a: False
– b <= c: True

If statement

a = 40
b = 267
if b > a:
print(“b is greater than a”)

Indentation
a = 42
b = 200
if b > a:
     print(“b is greater than a”)

Elif statement( Elif = Else if)

a = 4
b= 4
if b > a:
     print(“b is greater than a”)
elif a == b:
     print(“a and b are equal”)

Else statement

a = 250
b = 50
if b > a:
      print(‘b is greater than a”)
elif a == b:
      print(“a and b are equal”)
else:
     print(“a is greater than b”)

Loops

for i in ‘Python’:

print ‘My code :’, i

 

My code : p

My code : y

My code : t

My code : h

My code : o

My code : n

 

List:

supplies = [‘pen’, ‘apple’, ‘mango’]

for supply in supplies:

print ‘Current supply :’, supply

 

Current supply :pen

Current supply :book

Current supply :mango

 

Break statement:

fruits = [‘mango’, ‘grape’, ‘orange’]

for x in fruits:

print (x)

if x == ‘grape’

break

 

mango

grape

 

Range function:

for x in range(5):

print(x)

 

0

1

2

3

4

 

Science Round 3: Carbon

Carbon is a nonmetal element in group 14 with the atomic number of 6, which has four valence electrons A carbon atom can form bonds with other carbon atoms or with the atoms of other elements. It often forms bonds with hydrogen. The carbon atom in a methane molecule forms bonds with four hydrogen atoms. Proteins, nucleic acids, lipids (cholesterol), carbohydrates, and other molecules essential to life contain carbon. Carbon is present in the atmosphere as carbon dioxide (C02), which makes up approximately 0.04% of the atmosphere.

In our class, we also did a science experiment and below is the Lab Report:

Black Carbon Snake

Question:

What will happen if you mix sugar and baking soda and pour the mixture in the mound of sand that’s soaked with alcohol?

 

Hypothesis:  

the mixture will burn and turn into a black, solid

 

Ingredients/Materials:

  • Baking soda
  • Sugar
  • Alcohol
  • Sand
  • Fire match
  • Aluminum foil
  • Bowl
  • Plate

 

Procedure:

  • In the plate, mix 1 and a half tablespoons of sugar with 3 tablespoons of baking soda
  • In a separate bowl, wrap it with aluminum foil and fill ¾ of the bowl with sand, then make a basin in the center
  • Soak the sand with alcohol, make sure that the center is extremely saturated
  • Pour the mixture in the basin and drop several drops of alcohol on it
  • Carefully, lit up the match and drop into the bowl

Explanation:

Due to the heat, it breaks the sugar bond (Carbon, Hydrogen, and Oxygen) and turns hydrogen and oxygen into gases, as a result, forming the carbon ash (snake). In the mixture, we added baking soda and when it’s heated, it releases carbon dioxide, which just like what baking soda does, allows the carbon ash to rise up. The role of sand that soaked with alcohol is to distribute the heat, making a continuous and steady fire.