0% found this document useful (0 votes)
22 views2 pages

Python Code

The document contains code snippets demonstrating different Python concepts like variables, data types, input, string formatting and arithmetic operations.

Uploaded by

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

Python Code

The document contains code snippets demonstrating different Python concepts like variables, data types, input, string formatting and arithmetic operations.

Uploaded by

Vic Barrientos
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

https://www.onlinegdb.

com/online_python_compiler

https://drive.google.com/drive/folders/1I2UcBCDAgPzLMEcNx3ka1YZt4Ooj42db

https://classroom.google.com/c/NDI3MTU2OTQ3MjE0/m/NDM0Mzk5NTAxMTg2/details

https://mail.google.com/mail/u/0/#inbox/FMfcgzGlksFnJNFKQhWstKWlRBNzhSfj

firstname = "VIC"

lastname = "BARRIENTOS"

print("firstname: " + str(firstname))

print("lastname: " + str(lastname))

++++++++++++++++++++++++++++++++++++++++++++++++++++++++

name = "VIC RAMOS BARRIENTOS"

number = 143

oilPrice = 23.5

isTrue = True

#str(variable_name)

#int(variable_name)

#float(variable_name)

print("Enter a number",number)

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

name = input("Enter a name: ")

age = int(input("Enter you age: "))

print(name)

print("Your age is ",age)

=====================================================

price = float(input("Enter price: "))

print("The price is ",price)


+++++++++++++++++++++++++++++++++++++++++

lyrics1 = "Ako sayo at ikaw 'akin' lamang"

lyrics2 = 'Ako sayo at ikaw "akin" lamang'

print(lyrics1)

print(lyrics2)

++++++++++++++++++++++++++++++++++++++++

item = "milk"

cost = 35.35

sampleText4 = "The product %s cost %.2f" % (item, cost)

print(sampleText4)

+++++++++++++++++++++++++++++++++++++++++++++++++++

age = 23

year = 2021

sentece = "I am %i year old this year %d" % (age,year)

print(sentece)

You might also like