Program to print Python string
Str1 = "Welcome"
Str2 = "Computer Science"
print(str1*3)
print(str1+str2)
print(str1[4])
print(str1[2:4])
Program to print the largest of the three numbers.
a = int(input("Enter a? "));
b = int(input("Enter b? "));
c = int(input("Enter c? "));
if a>b and a>c:
print("a is largest");
if b>a and b>c:
print("b is largest");
if c>a and c>b:
print("c is largest");
Program to create a Students Mark sheet.
marks=int(input("Enter the marks"))
if marks>85 and marks<=100:
print("Congrats ! you scored grade A...")
elif marks>60 and marks<=85:
print("You scored grade B++...")
elif marks>40 and marks<=60:
print("you scored grade B...")
elif marks>30 and marks<=40:
print("you scored grade c...")
else:
print("Sorry you are fail")
Program to implement functions
def print_new():
print("I am a function")
print("My name is print_new")
print_new()
Program to Implementing Functions Without Arguments Using Python
def my_func():
x = 10
print("Value inside function:",x)
x = 20
my_func()
print("Value outside function:",x)