You are on page 1of 1

In [4]: #Welcome our students to the first Lab, directed by Lecturer Dr.Eng.Zaidoon.T.

AL-Qaissi
In [2]: print("hello")

hello
In [ ]: # is use ti insert "Comments"
In [3]: # variables
x=5
y=2
z=x+y
print (z)
7
In [4]: x=5
y=2.0
z=x+y
print (z)
7.0
In [1]: # Getting the variables type
x=5
y=2.0
z=x+y
print (z)
print (type(x))
print (type(y))
7.0
<class 'int'>
<class 'float'>
In [8]: x=5
y=2.0
str= 'Students' #string
print (type(str))
print (type(x)) #int
print (type(y)) #float
<class 'str'>
<class 'int'>
<class 'float'>
In [1]: # Multi-Line String with ''
str= '''Welcom students again in our class
I hope the class
not be boring'''
print (str)
Welcom students again in our class
I hope the class
not be boring
In [2]: # Multi-Line String with ""
str= """Welcom students again in our class
I hope the class
not be boring"""
print (str)
Welcom students again in our class
I hope the class
not be boring
In [3]: # String Sliecing
str= "Welcome Students"
print(str[2])
print(str[1:4])
l
elc
Loading [MathJax]/jax/output/CommonHTML/fonts/TeX/fontdata.js

You might also like