8000 Merge branch 'master' of https://github.com/avinashn/programminginpyt… · brohimah/programminginpython.com@5c22d68 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5c22d68

Browse files
committed
2 parents 34a6f03 + 3b22d09 commit 5c22d68

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

lcm_python.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
__author__ = 'Avinash'
2+
3+
num1 = int(input("Enter first number: \t"))
4+
num2 = int(input("Enter second number: \t"))
5+
6+
numbers_min = min(num1, num2)
7+
8+
while(1):
9+
if(numbers_min % num1 == 0 and numbers_min % num2 == 0):
10+
print("LCM of two number is: ", numbers_min)
11+
break
12+
numbers_min += 1

sum_elements_list.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
__author__ = 'Avinash'
2+
__author1__ = 'ramlaxman'
23

34
lst = []
4-
num = int(input('How many numbers: '))
5-
for n in range(num):
6-
numbers = int(input('Enter number '))
7-
lst.append(numbers)
5+
total = int(input('Total numbers in List: '))
6+
7+
for num in range(total):
8+
num = int(input('Enter number '))
9+
lst.append(num)
10+
811
print("Sum of elements in given list is :", sum(lst))

0 commit comments

Comments
 (0)
0