0% found this document useful (0 votes)
0 views13 pages

Tech 2 Python Basic 2

The document consists of five parts, each demonstrating various programming concepts, including calculating the area of a triangle, collecting user information, making decisions based on age, and gathering PC specifications. It emphasizes the use of IF/ELSE statements and comparison operators to control program flow and logic. Additionally, it discusses the importance of logical operators for creating complex conditions in programming.

Uploaded by

G :D
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)
0 views13 pages

Tech 2 Python Basic 2

The document consists of five parts, each demonstrating various programming concepts, including calculating the area of a triangle, collecting user information, making decisions based on age, and gathering PC specifications. It emphasizes the use of IF/ELSE statements and comparison operators to control program flow and logic. Additionally, it discusses the importance of logical operators for creating complex conditions in programming.

Uploaded by

G :D
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

Part #1:

#The introduction

print("----- PART 1 -----")

#the print of our names


name1 = "Abner Rodriguez"

print(name1)

name2 = "Henry Gu"

print(name2)

name3 = ("Gian Rovetto")

print(name3)

#so it separates the parts

print("-------------------")
#so we know what are we gonna calculate

print("Let's calculate the area of a triangle")

#so it separates the parts x2

print("-------------------")

#the base of the triangle

base = int(input("Send the value of the Base:"))

#the height for the triangle


height = int(input("Send the value of the Height:"))

#area = base * height/2 for us to get the area

area = base * height/2

#the values of the triangle

print("Your values are here")

print("Base=", base)

print("Height=", height)
#so it separates the parts x3
print("-------------------")

#the value to calculate the area

print("The area of the triangle is:")

print("are =", area)


print("-------------------")

Part #2:
#The introduction
print("----- PART 2 -----")

#the print of our names

name1 = "Abner Rodriguez"

print(name1)
name2 = "Henry Gu"

print(name2)

name3 = ("Gian Rovetto")

print(name3)

#so it separates the parts

print("-------------------")

#so that the form can operate

print("Please complete the following form")


#so it separates the parts x2

print("-------------------")

#the name of the user

person_name = input("what is your name?")

#the last name of the user

person_lastname = input("what is your last name?")

#the age of the user


person_age = input("what is your age?")

#the degree of the user

person_degree = input("what is your degree?")

#so he knows we have morals

print("Thanks for your time!")

print("Here's your report")

print("-------------------")
print("Bank of America")
print("User account data:")

print("Full name:", person_name, person_lastname)

print("Age", person_age)

print("Degree", person_degree)
print("-------------------")

print("sign here:_________________________")

Part #3:
#The introduction

print("----- PART 3 -----")

#the print of our names

name1 = "Abner Rodriguez"


print(name1)

name2 = "Henry Gu"

print(name2)

name3 = ("Gian Rovetto")

print(name3)

#so it separates the parts

print("-------------------")

#so that the form can operate


print("Let's take decisions!")

#so it separates the parts x2

print("-------------------")

#the name of the user

person_name = input("what is your name?")

#the last name of the user

person_lastname = input("what is your last name?")


#the age of the user

person_age = int(input("How old are you?"))

#if the person is 21 you can drink alcohol

if person_age > 21:

print("-------------------")

print("Full name: ", person_name, person_lastname)

print("Age: ", person_age)


print("You're able to drink alcohol!")
print("-------------------")

#if the person is 18-21 just wait a bit more

elif person_age <= 21 and person_age >= 18:

print("Full name: ", person_name, person_lastname)


print("Age:", person_age)

print("You should not be drinking alcohol yet!")

print("-------------------")

#if the person is 0-17 print the miskshake

elif person_age <= 17 and person_age >= 0:

print("-------------------")

print("Full name: ", person_name, person_lastname)

print("Age: ", person_age)


print("Here is a chocholate milkshake buddy!")

print("-------------------")
else:

#print yuno

print("-------------------")

print("""

░░░░░░░░░░░▄▄▀▀▀▀▀▀▀▀▄▄

░░░░░░░░▄▀▀░░░░░░░░░░░░▀▄▄

░░░░░░▄▀░░░░░░░░░░░░░░░░░░▀▄

░░░░░▌░░░░░░░░░░░░░▀▄░░░░░░░▀▀▄

░░░░▌░░░░░░░░░░░░░░░░▀▌░░░░░░░░▌

░░░▐░░░░░░░░░░░░▒░░░░░▌░░░░░░░░▐

░░░▌▐░░░░▐░░░░▐▒▒░░░░░▌░░░░░░░░░▌
░░▐░▌░░░░▌░░▐░▌▒▒▒░░░▐░░░░░▒░▌▐░▐

░░▐░▌▒░░░▌▄▄▀▀▌▌▒▒░▒░▐▀▌▀▌▄▒░▐▒▌░▌

░░░▌▌░▒░░▐▀▄▌▌▐▐▒▒▒▒▐▐▐▒▐▒▌▌░▐▒▌▄▐

░▄▀▄▐▒▒▒░▌▌▄▀▄▐░▌▌▒▐░▌▄▀▄░▐▒░▐▒▌░▀▄

▀▄▀▒▒▌▒▒▄▀░▌█▐░░▐▐▀░░░▌█▐░▀▄▐▒▌▌░░░▀

░▀▀▄▄▐▒▀▄▀░▀▄▀░░░░░░░░▀▄▀▄▀▒▌░▐

░░░░▀▐▀▄▒▀▄░░░░░░░░▐░░░░░░▀▌▐
░░░░░░▌▒▌▐▒▀░░░░░░░░░░░░░░▐▒▐

░░░░░░▐░▐▒▌░░░░▄▄▀▀▀▀▄░░░░▌▒▐

░░░░░░░▌▐▒▐▄░░░▐▒▒▒▒▒▌░░▄▀▒░▐

░░░░░░▐░░▌▐▐▀▄░░▀▄▄▄▀░▄▀▐▒░░▐

░░░░░░▌▌░▌▐░▌▒▀▄▄░░░░▄▌▐░▌▒░▐

░░░░░▐▒▐░▐▐░▌▒▒▒▒▀▀▄▀▌▐░░▌▒░▌

░░░░░▌▒▒▌▐▒▌▒▒▒▒▒▒▒▒▐▀▄▌░▐▒▒▌
""")
Part #4:

#The introduction
print("----- PART 4 -----")
#the print of our names

name1 = "Abner Rodriguez"

print(name1)

name2 = "Henry Gu"


print(name2)

name3 = ("Gian Rovetto")

print(name3)

#so it separates the parts

print("-------------------")

#so that the form can operate

print("This is getting long SMH!")

#so it separates the parts x2


print("-------------------")

ans = input("Do you own a PC? (y/n)")

if ans== "y":

#question so that we know more about the persons PC

pc_type = input("What type of PC is? (Laptop/Desktop/Custom)")

#so that we know the type of PC/Laptop or desktop


pc_ram = input("How much ram (GBS) does your pc have")

#so that we know how much ram the PC has

pc_storage = input("How much Storage (GBS) does you PC have?")

ans = input ("Do you know the CPU brand? (y/n)")

if ans == "y":

#the CPU of the pc

pc_cpu = input("Which CPU your PC has?")


else:

print("Unknow brand!")

pc_cpu = "N/A"

#a generic default profile


else:

#the specs of the default profile

print("Generating a default profile!")

pc_type = "Desktop"

pc_ram = 18

pc_storage = 1024

pc_cpu = "Intel Core 5 Ultra 125H"

print("-------------------")
print("PC reposrt: ")

print(f"PC type: {pc_type}")

print(f"PC RAM: {pc_ram} GBS")

print(f"PC ROM {pc_storage} GBS")

print(f"pc RAM: {pc_cpu}")

print("-------------------")
Part 5: Research

When you write code and you have an IF/ELSE statement it is like a fork in the road,
leading this fork in the road to help decide which path the program should take. The
program relies on operators to check if a condition is true or false. These operators are
like the decision makers, it decides how the software behaves.

The tool that people use is comparison operators, these let you match values against
each other, people can use comparison operators to check if two things are exactly
equal. Also, they can also use them to check if one number is bigger, than another
number and can use them to check if a value falls within a certain limit.

To build complex logic you can use comparison operators together with logical
operators like AND and OR, these operators let you tell the program to only take a
specific path if multiple conditions are met at the same time, so we can use them to tell
the program to take a path if at least one of the conditions works out, making they have
control over the flow of your code.

(IBM Corporation, 2026-01-16)

You might also like