Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 7199444

Browse files
Code
1 parent bf6a455 commit 7199444

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+843
-0
lines changed

‎1.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
arr = [10,20,30,40,50]
2+
key = 27
3+
if key in arr:
4+
print("\nKey Found")
5+
else:
6+
print("\nKey is not Found")

‎10.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Write a Python Program to Accept a filename from the user and print the extension of that.
2+
filename = input("Input the Filename: ")
3+
f_extns = filename.split(".")
4+
print("The Extension of the file is: " + repr(f_extns[-1]))

‎100.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Write a Program to Print Multiplication Table of N Using for Loop in Reversed Order.
2+
3+
num = int(input("Enter the Number: "))
4+
for i in range(10,0,-1):
5+
# print(str(num) + " X " + str(i) + " = " + str(num*i))
6+
print(f"{num} X {i} = {num*i}")

‎11.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Write a Python Program to Display the first and last Colors from the following List.
2+
color_list = ["Red","Green","White","Black"]
3+
print("%s %s"%(color_list[0],color_list[-1]))

‎12.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Write a Python Program to Display the Examination Schedule.(extract the date from exam_st_date).
2+
exam_st_date = (11,12,2014)
3+
print("The Examination Will Start From: %i / %i / %i"%exam_st_date)

‎13.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Python Program to Check Leap Year.
2+
3+
Year = int(input("Enter a Year: "))
4+
5+
# Getting Value for User
6+
if(Year%4)==0:
7+
if(Year%100)==0:
8+
if(Year%400)==0:
9+
print("{0} is a Leap Year".format(Year))
10+
else:
11+
print("{0} is Not a Leap Year".format(Year))
12+
else:
13+
print('{0} is a Leap Year'.format(Year))
14+
# Number will be printed as leap year
15+
else:
16+
print("{0} is Not a Leap Year".format(Year))
17+
# Number will be printed as non leap year

‎14.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
def evenOdd(x):
2+
if( x % 2 == 0):
3+
print("Even")
4+
else:
5+
print("Odd")
6+
7+
evenOdd(2)
8+
evenOdd(5)

‎15.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
def my_function(fname, lname):
2+
print(fname + " " + lname)
3+
4+
my_function("Sagar","Goswami")

‎16.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Write a Python Program that Accepts an Interger (n) and Computes the Value of n+nn+nnn.
2+
a = int(input("Input an Integer: "))
3+
n1 = int("%s" %a)
4+
n2 = int("%s%s" % (a,a))
5+
n3 = int("%s%s%s" % (a,a,a))
6+
print(n1+n2+n3)

‎17.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Write a Python Program to Calculate Square of a Number Entered by the User.
2+
a = input('Enter Number: ')
3+
a = int(a)
4+
sq = a**2
5+
print('Square is: ', sq)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /