Professional Documents
Culture Documents
DS Program File 3
DS Program File 3
myint=7
myfloat_1=5.2
myfloat_2=float(9)
mystring_1='hello'
mystring_2="hello"
print(myint)
print(myfloat_1)
print(myfloat_2)
print(mystring_1)
print(mystring_2)
7
5.2
9.0
hello
hello
one = 1
two = 2
three = one + two
print(three)
hello = "hello"
world = "world"
helloworld = hello + " " + world
print(helloworld)
3
hello world
a=3;b=4
print(a);print(b)
a, b = 3, 4
print(a,b)
3
4
3 4
localhost:8888/notebooks/DS_Program_File_3.ipynb# 1/4
3/4/2021 DS_Program_File_3 - Jupyter Notebook
one = 1
two= 5.6
print(one +int(two)) # type casting
print(one+two)
6
6.6
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-13-a37dc3e0f605> in <module>
2 one=1;
3 two="hello"
----> 4 print(one+two)
▾ if mystring == "hello":
print("String: %s" % mystring)
# print("String:", mystring)
▾ if isinstance(myfloat, float) and myfloat == 10.0:
print("Float: %f" % myfloat)
▾ if isinstance(myint, int) and myint == 20:
print("Integer: %d" % myint)
String: hello
String: hello
Float: 10.000000
Integer: 20
"""This is a comment
written in
more than just one line"""
print("Hello, World!")
Hello, World!
localhost:8888/notebooks/DS_Program_File_3.ipynb# 2/4
3/4/2021 DS_Program_File_3 - Jupyter Notebook
3 3 3.0
<class 'str'> <class 'int'> <class 'float'>
50 Great
localhost:8888/notebooks/DS_Program_File_3.ipynb# 3/4
3/4/2021 DS_Program_File_3 - Jupyter Notebook
apple
banana
cherry
In [ ]:
localhost:8888/notebooks/DS_Program_File_3.ipynb# 4/4