0% found this document useful (0 votes)
16 views1 page

Python Code Pad: Run & Save Code

The document is a Python code snippet that demonstrates basic functionalities such as printing to the console, defining and calling functions, importing libraries, and creating classes. It includes a simple greeting function, displays the current date and time, and calculates the sum of two user-inputted numbers. The code serves as an introduction to coding in Python 3.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views1 page

Python Code Pad: Run & Save Code

The document is a Python code snippet that demonstrates basic functionalities such as printing to the console, defining and calling functions, importing libraries, and creating classes. It includes a simple greeting function, displays the current date and time, and calculates the sum of two user-inputted numbers. The code serves as an introduction to coding in Python 3.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

# Welcome to Python Code Pad

# Code is automatically saved on edit


# Use it to run Python 3 code

# Print to the console


print('Python is awesome')

# Write functions
def greeting():
return 'Hello'

# Call functions
print(greeting())

# Import from Standard Library


import datetime
now = [Link]()
print(now)

# Create and work with classes


class Greeting:
def greet(self, name):
return 'Hello ' + name

print(Greeting().greet('Developer'))

# Have fun coding in Python


a=int(input("Enter 1st no"))
b=int(input("Enter 2nd no"))
c=a+b
print("Sum of two number is",c)

You might also like