Core Python Notes
Core Python Notes
Core Python Notes
-----------
float(10)
o/p
10.0
Ex2
----------
a=20
float(a)
o/p
20.0
Ex3
----------
float("10")
o/p
10.0
Ex4
----------------
float(True)
o/p
1.0
Ex5
--------------
float(False)
o/p
0.0
-----------------------------------------
3)
str()
this method will convert given value into
string data type..
For example
----------------------
Ex1
-----------
>>> str(10)
o/p
----------------
'10'
Ex2
--------------
>>> str(10.5)
o/p
---------------
'10.5'
Ex3
--------------
>>> str(True)
o/p
-----------
'True'
ex4
------------------
>>> str(False)
o/p
------------
'False'
>>>
4)bool()
-----------------------------------------------------
->
this method wil convert the given value into
bool..
Examples
-----------------
Ex1
-------------
>>> bool(10)
o/p
----------
True
Ex2
-----------
>>> bool(10.5)
o/p
--------------
True
Ex3
-----------
>>> bool("rama")
o/p
------------
True
Ex4:
---------------
>>> bool(True)
o/p
-----------
True
>>>
input()
->this method will accept input
from the user by displyaing user fiendly
message till user press enter key..
once user pressed enter key this method will
return that accepted value as string..type..
task1
write a python program to accept 2 numbers
and perform sub and display sub result.
task2
write a python program to accept 2 numbers
and perform miltiplication and display mul result.
task3:
write a python program to accept 2 numbers
and perform div and display div result.
Q: yes
Q: completed
Q: integer
Q: float()
Q: tracing completed
Q: i am doing with u
Q: yes
Q: me
Q: yes
Q: recorded
Q: clear
Q: for loop, while loop,for loop with else,while loop with else
Q: for loop, while loop,for loop with else,while loop with else
Chat
RN Reddy IT School (Organizer, Presenter)to Everyone
o/p
1 2 3 4 5 6 7 8 9 10
o/p
10 9 8 7 6 5 4 3 2 1
public 8:34 PM