forked from DAN-329/C_to_Python_translator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpy-program.txt
43 lines (42 loc) · 847 Bytes
/
py-program.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import string
import math
def work(i):
while(i<10):
print("The value of i is {}\n".format(i))
i+=1
def work2(num):
sum=0
for i in range(0,num):
sum+=k
print("The sum is {}\n".format(sum))
arr2=[1,2,3,4,5,6,7,8,9]
print("Enter your name\n")
name=input()
print("Enter a or b or c\n")
ch=input()
if ch== 'a':
print("The letter is {}\n".format(ch))
elif ch== 'b':
print("The letter is {}\n".format(ch))
elif ch== 'c':
print("The letter is {}\n".format(ch))
else:
print("Invalid input\n")
print("Enter the value of i\n")
work(i)
print("Enter values of a and b\n")
a=int(input())
b=int(input())
if(a>b):
print("a is bigger\n")
else:
print("b is bigger\n")
print("Enter the value of j\n")
j=int(input())
while True:
print("The value of j is {}\n".format(j))
j+=1
if j>=10 : break
print("Enter a number\n")
num=int(input())
work2(num)