WPM
100
CPM
100
Errors
0
Time
15Min
Accuracy
100%
Start Pythons code typing Practice. Python codes over functions, python type conversion typecasting, datatypes, literals, input-output and python namespace scope.Click on the area below to start typing.

S.No.Paragraph : Practice repeatedly whatever you would like most for full fifteen minutes Lessionsclick to Practice
1number = 10 number = 1.1 website = "apple.com" print(website) website = "apple.com" print(website) # assigning a new value to website website = "programiz.com" print(website) a, b, c = 5, 3.2, "Hello" print (a) print (b) print (c)1.1 Python Variable, Constant and literals
2#Python Numbers a = 5 print(a, "is of type", type(a)) a = 2.0 print(a, "is of type", type(a)) a = 1+2j print(a, "is complex number?", isinstance(1+2j,complex)) a = [5,10,15,20,25,30,35,40] #Python List # a[2] = 15 print("a[2] = ", a[2]) # a[0:3] = [5, 10, 15] print("a[0:3] = ", a[0:3]) # a[5:] = [30, 35, 40] print("a[5:] = ", a[5:])1.2 Python Datatypes
3num_int = 123 num_flo = 1.23 num_new = num_int + num_flo print("datatype of num_int:",type(num_int)) print("datatype of num_flo:",type(num_flo)) print("Value of num_new:",num_new) print("Data type of num_int:",type(num_int)) print("Data type of num_str:",type(num_str)) print(num_int+num_str) print("datatype of num_new:",type(num_new))1.3 Python type conversion and typecasting
4#output Formating >>> x = 5; y = 10 >>> print('The value of x is {} and y is {}'.format(x,y)) The value of x is 5 and y is 10 >>> x = 12.3456789 >>> print('The value of x is %3.2f' %x) The value of x is 12.35 >>> print('The value of x is %3.4f' %x) The value of x is 12.3457 #Python Input >>> num = input('Enter a number: ') Enter a number: 10 >>> num '10'1.4 input-output in python
5# Note: You may get different values for the id a = 2 print('id(a) =', id(a)) a = a+1 print('id(a) =', id(a)) print('id(3) =', id(3)) def printHello(): print("Hello") def outer_function(): b = 20 def inner_func(): print('id(b) =', id(b)) print('id(2) =', id(2))1.5 Python Namespaces and Scope