Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
12 views

Python

This document discusses built-in Python functions like print, round, char, ord, and input. It covers topics like slicing strings, sequence types, formatting, loops, conditional operators, truth value testing and more.

Uploaded by

tempmail
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

Python

This document discusses built-in Python functions like print, round, char, ord, and input. It covers topics like slicing strings, sequence types, formatting, loops, conditional operators, truth value testing and more.

Uploaded by

tempmail
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

https://docs.python.org/3/library/functions.

html (Python built in functions)


**Python Functions

print- to print something


round- to round the number of digits next to decimal points
char and ord- to convert characters to their numeric representations
input- to accept a value from user
syntax to input an integer
age=int(input("What2201020201 is your age "))
\n-print on a new line
\t-add 6 spaces

**while defyning an object palce the object in double course("")


Ex:
cat="persion cat"
print(cat)

**Expression
+ add
- subtract
* multiply
/ division(with floating point)
// division(rounded off)
% remainder

**slicing a string
Ex:
012345678901
Cat= "Persian Cat"
print(cat[5])
#output: A

**Python Sequence Types


string type
list
tuple
range
byte and bytearray

**Replacement field
{0}.format(age)

**for loop
for i in range(0,20):
print(i)

**Conditional Operators
< less than
<= less than equal to
> greater than
=> less than equal to
== equal to
!= Not equal to

**truth value testing

constants defined to be false: None and False.


zero of any numeric type: 0, 0.0, 0j, Decimal(0), Fraction(0, 1)
empty sequences and collections: '', (), [], {}, set(), range(0)

a list in enclosed in square brackets

https://docs.python.org/3/library/functions.html (Python built in functions)

You might also like