-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathTestingIn
More file actions
159 lines (136 loc) · 2.87 KB
/
Copy pathTestingIn
File metadata and controls
159 lines (136 loc) · 2.87 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
#Using pyperclip third party module for copy and paste
#import pyperclip
#pyperclip.copy("I am hero ")
#print pyperclip.paste()
#Using sys module
#import sys
#for i in range(101):
# if i>50:
# sys.exit()
# print i
#Using random module
#import random
#print random.randint(1,10)
'''
def hello():
print "Howdy!"
print "hello"
print hello()
import sys,os
def main():
print "hello dharmu",sys.argv[1]
if __name__=='__main__':
print os.getcwd()
main()
'''
#print (round(95.0,2))
#print ("%.2f" %
#print (format(95.345, ".2f"))
# "%.2f" % a
##################################################
'''
from __future__ import print_function
import os
import sys
def maximumProgramValue(n):
result = 0
while n:
n = n - 1;
t = raw_input()
# print (t+"--->input")
if str[0] == "a":
print("inside add")
# if result<(result+int(str[5])):
# result=result+int(str[5])
if str[0] == "set":
print("inside set")
# if result<int(str[5]):
# result=int(str[5])
return result
if __name__ == '__main__':
n = int(raw_input())
result = maximumProgramValue(n)
print (result)
#print (float(input("entre your number")))
print type(input("entre your number"))
'''
# re1=[1,2,3,4,5,6,2,2,2,2,2,2,2,7,8]
# re2=[10,23,10,10]
# print "The elements",re1[4:12:3]
# print "The index of 10 is %s"%re2.index(10)
# re=re1+re2
# re=re*2
# print re
# print "The length of list=%s"%len(re)
# print "The count of list=%s"%re.count(2)
#
# name="Dharmpal"
# print "Thee name is %s"%name
# age=22
# print "%s is %1.4f year old"%(name,age)
#
# str="Hello World!"
# print str[::-1]
# print str.lower()
# print str.upper()
# print str.startswith("Hello")
# print str.split()
# x=10
# y=10
# print "Here",not x is y
# count=0
# while count<5:
# print "Count",count
# count+=1
# else:
# print "Dharmu"
# def list_benefits():
# li=[]
# li.append("More organized code")
# li.append("More readable code")
# li.append("Easier code reuse")
# li.append("Allowing programmers to share and connect code together")
# #li.append()
# return li
# print list_benefits()
# dict={}
# dict1={
# "Ram":1,
# "Shyam":2,
# "Dhyan":3
# }
# print dict
# print dict1
# dict["hI"]="1"
# #dict.update({"Na","2"})
# print dict.keys()
# #
# # import draw
# height=[1.80,6.45,7.80,6.56]
# weight=[3,5,7,45.6]
# import numpy
def fib(n):
if(n<2):
yield n
li=[0,1]
for i in range(2,n+1):
li.append(li[i-1]+li[i-2])
re=li[n]
yield re
def factorial(num):
if num<2:
yield 1
fact=1
for i in range(1,num+1):
fact=fact*num
yield fact
def factorial2(num):
if num<2:
return num
return num*factorial2(num-1)
#my_name=factorial(4)
my_name=fib(6)
print my_name
for i in my_name:
print i
#print factorial2(4)