We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bdb2d10 commit a847f9eCopy full SHA for a847f9e
add_two_numbers.py
@@ -0,0 +1,27 @@
1
+import random
2
+a= input("Enter a no of your choice")
3
+b= input("Enter a second no of your choice")
4
+sum = a+b
5
+print('The sum of two numbers is {}'.format(sum) )
6
+
7
8
+#square root of user input number.
9
+square_root= a**0.5
10
+print('The square root of {} is {}'.format(a, square_root) )
11
12
+#generate random number
13
+c= random.randint(1, 100)
14
+print('A random number in range of 1 to 100 is {}'.format(c))
15
16
+#check prime number or not, we're checking b here.
17
+for i in range (2,b-1,1):
18
+ if ( b%i==0):
19
+ print('The number {} is not prime'.format(b))
20
+ break
21
+ else:
22
+ print('Prime Number')
23
24
25
+#
26
27
0 commit comments