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

Recap Lec 7 Python 1

Uploaded by

www.farahhssan
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)
26 views2 pages

Recap Lec 7 Python 1

Uploaded by

www.farahhssan
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
You are on page 1/ 2

Name: ID: Date:

Lecture: Accounting Application Development Course code: ACC 353


Python 1
First Code:
3+ 5

Print (3+5)
Data Types and Operators:
Print ( 1 + 2+ 3 *3)
Print (3**2)
Print (9 % 2)
Print (9 // 2)
Variables:
x=2
y=3
z=5
print (x+y)

f, m, n = 4, 5, 7
print (f * m)

Call Functions
-max (1,5,7)
-print (abs(-134))
-round (.2345)

- String
print ("Hello World")

repetition
word = "sara"
print (word * 5)
Concatenation
- first_name= "Sara"
- Last_name = "Sabry"
- print (first_name)
- print (Last_name)
- print (first_name+Last_name)
- print (first_name+" "+Last_name)

Types of Data
print (type(456))
print (type("456"))
print (type(456.00))

balance = 888.88
dollars = 899
print (str(dollars))
print (int(balance))
- balance = 888.88
dollars = 899
balanceAsString = str(balance)
dollarsAsString = str(dollars)
print(balanceAsString)
print(dollarsAsString)

Updating an assignment variables:


Increase variable x by 2
x +=3
print (x)

Print (x + z)
Types of Data:
print (type (4))

print (type (3.4))


Convert from one type to another
print(3.4)
print(int(3.4))
print (3000+5000)
print (float(3000+5000))

You might also like