Skip to content

Commit 293d94f

Browse files
committed
updated files
1 parent a343d3f commit 293d94f

Some content is hidden

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

58 files changed

+2452
-2240
lines changed
Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
'''
2-
author : Jaydatt
3-
variables
4-
'''
5-
message = "Python"
6-
val = 2023
7-
pi = 3.14
8-
b = True
9-
set = {5,6}
10-
list = [5]
11-
tuple = (5,)
12-
i = (5) # integer
1+
'''
2+
author : Jaydatt
3+
variables
4+
'''
5+
message = "Python"
6+
val = 2023
7+
pi = 3.14
8+
b = True
9+
set = {5,6}
10+
list = [5]
11+
tuple = (5,)
12+
i = (5) # integer
1313
dic = { "name" : "rahul" , "id" : 1234}

Type.py renamed to 02-Type.py

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
1-
'''
2-
author : Jaydatt
3-
type function
4-
'''
5-
def square(x):
6-
return (x * x)
7-
8-
set = {5,6}
9-
list = [5]
10-
tuple = (5,)
11-
i = (5)
12-
dic = { "name" : "rahul" , "id" : 1234}
13-
14-
print('1.',type(square))
15-
print('2.',type(10))
16-
print('3.',type(3.14))
17-
print('4.',type('Jd Python'))
18-
print('5.',type('''"BCA"'''))
19-
print('6.',type(True))
20-
print('7.',type(False))
21-
22-
print('8.',type(None))
23-
24-
print('9.',type(set))
25-
print('10.',type(list))
26-
print('11.',type(tuple))
27-
print('12.',type(i))
28-
print('13.',type(dic))
29-
30-
31-
1+
'''
2+
author : Jaydatt
3+
type function
4+
'''
5+
def square(x):
6+
return (x * x)
7+
8+
set = {5,6}
9+
list = [5]
10+
tuple = (5,)
11+
i = (5)
12+
dic = { "name" : "rahul" , "id" : 1234}
13+
14+
print('1.',type(square))
15+
print('2.',type(10))
16+
print('3.',type(3.14))
17+
print('4.',type('Jd Python'))
18+
print('5.',type('''"BCA"'''))
19+
print('6.',type(True))
20+
print('7.',type(False))
21+
22+
print('8.',type(None))
23+
24+
print('9.',type(set))
25+
print('10.',type(list))
26+
print('11.',type(tuple))
27+
print('12.',type(i))
28+
print('13.',type(dic))
29+
30+
31+
Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
'''
2-
author : Jaydatt
3-
typecast
4-
'''
5-
print("cast int to float or string :")
6-
print(float(10))
7-
print(str(10))
8-
9-
print("cast float to int or string :")
10-
print(int(3.14))
11-
print(str(3.14))
12-
13-
14-
print("cast string to int or float :")
15-
print(int('123'))
16-
print(int(float('123.45')))
17-
print(float('123.45'))
1+
'''
2+
author : Jaydatt
3+
typecast
4+
'''
5+
print("cast int to float or string :")
6+
print(float(10))
7+
print(str(10))
8+
9+
print("cast float to int or string :")
10+
print(int(3.14))
11+
print(str(3.14))
12+
13+
14+
print("cast string to int or float :")
15+
print(int('123'))
16+
print(int(float('123.45')))
17+
print(float('123.45'))

Print.py renamed to 04-Print.py

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
1-
'''
2-
author : Jaydatt
3-
print function
4-
'''
5-
print('Hello" World !' , 2023 )
6-
print("Hello ' World !")
7-
print("""" Hello "
8-
' World !'""")
9-
print('''" Hello "
10-
World !''')
11-
print('int : ', 10)
12-
print('float : ',3.14)
13-
print("2**3 :",2**3)
14-
15-
course = "Python"
16-
year = 2023
17-
18-
'''
19-
(string with {}....).format(ele1,ele2,.....)
20-
For two decimal places, put :.2f
21-
'''
22-
print("Welcome to {} in {}.".format(course,year))
23-
24-
x = 2
25-
y = 6
26-
print('sum of {} and {} is {}; product: {}.'.format( x, y, x+y, x*y))
27-
28-
val = 3.145131
29-
print("Pi : {:.2f}".format(val))
30-
31-
names = ["Alexey", "Catalina", "Misuki", "Pablo"]
32-
33-
print("'{first}!' she yelled. 'Come here, {first}! {f_one}, {f_two}, and {f_three} are here!'".format(f_three = names[3], first = names[1], f_one = names[0], f_two = names[2]))
34-
35-
# error : 'The set is {​{​{}, {}​}​}.'.format(a, b)
1+
'''
2+
author : Jaydatt
3+
print function
4+
'''
5+
print('Hello" World !' , 2023 )
6+
print("Hello ' World !")
7+
print("""" Hello "
8+
' World !'""")
9+
print('''" Hello "
10+
World !''')
11+
print('int : ', 10)
12+
print('float : ',3.14)
13+
print("2**3 :",2**3)
14+
15+
course = "Python"
16+
year = 2023
17+
18+
'''
19+
(string with {}....).format(ele1,ele2,.....)
20+
For two decimal places, put :.2f
21+
'''
22+
print("Welcome to {} in {}.".format(course,year))
23+
24+
x = 2
25+
y = 6
26+
print('sum of {} and {} is {}; product: {}.'.format( x, y, x+y, x*y))
27+
28+
val = 3.145131
29+
print("Pi : {:.2f}".format(val))
30+
31+
names = ["Alexey", "Catalina", "Misuki", "Pablo"]
32+
33+
print("'{first}!' she yelled. 'Come here, {first}! {f_one}, {f_two}, and {f_three} are here!'".format(f_three = names[3], first = names[1], f_one = names[0], f_two = names[2]))
34+
35+
# error : 'The set is {​{​{}, {}​}​}.'.format(a, b)
Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
1-
'''
2-
author : Jaydatt
3-
input function to get input from user as string
4-
data of input always will be string.........
5-
'''
6-
# input function
7-
''' receive the string or value by input '''
8-
9-
name = input("Enter the name:") # data of input always will be string.........
10-
print(type(name))
11-
12-
13-
a = input("Enter the fist value:") # data of input always will be string.........
14-
x = int(a) # so we need to convert string to integer
15-
16-
b = input("Enter the second value:") # data of input always will be string.........
17-
y = int(b) # so we need to convert string to integer
18-
19-
z = (x + y)/2
20-
print('Average of x and y is',z)
21-
22-
23-
### Fix Enter Input in integer and float............
24-
print('\nEnter Input in integer and float............')
25-
m1 = int(input("Enter Marks1 in integer: "))
26-
m2 = int(input("Enter Marks2 in integer: "))
27-
m3 = float(input("Enter Marks3 in float: "))
28-
m4 = float(input("Enter Marks4 in float: "))
29-
myList = [m1, m2, m3, m4]
30-
myList.sort()
1+
'''
2+
author : Jaydatt
3+
input function to get input from user as string
4+
data of input always will be string.........
5+
'''
6+
# input function
7+
''' receive the string or value by input '''
8+
9+
name = input("Enter the name:") # data of input always will be string.........
10+
print(type(name))
11+
12+
13+
a = input("Enter the fist value:") # data of input always will be string.........
14+
x = int(a) # so we need to convert string to integer
15+
16+
b = input("Enter the second value:") # data of input always will be string.........
17+
y = int(b) # so we need to convert string to integer
18+
19+
z = (x + y)/2
20+
print('Average of x and y is',z)
21+
22+
23+
### Fix Enter Input in integer and float............
24+
print('\nEnter Input in integer and float............')
25+
m1 = int(input("Enter Marks1 in integer: "))
26+
m2 = int(input("Enter Marks2 in integer: "))
27+
m3 = float(input("Enter Marks3 in float: "))
28+
m4 = float(input("Enter Marks4 in float: "))
29+
myList = [m1, m2, m3, m4]
30+
myList.sort()
3131
print('\n',myList)
Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,41 @@
1-
'''
2-
author : Jaydatt
3-
function syntax:
4-
5-
def function_name(arg1,arg2,....) :
6-
statement..1..
7-
statement..2..
8-
9-
10-
'''
11-
def square(x):
12-
return (x * x)
13-
14-
def sub(x, y):
15-
return (x - y)
16-
17-
print(square)
18-
print(square(3))
19-
print(sub(6, 4))
20-
21-
# return immutable tuple
22-
def circleInfo(r):
23-
cir = 2 * 3.14159 * r
24-
area = 3.14159 * r * r
25-
return cir, area # return immutable tuple
26-
# or return (cir, area)
27-
print(circleInfo(10))
28-
circumference, area = circleInfo(10)
29-
print(circumference)
30-
print(area)
31-
32-
# return mutable list
33-
def circleInfo(r):
34-
cir = 2 * 3.14159 * r
35-
area = 3.14159 * r * r
36-
return [cir, area] # return mutable list
37-
38-
print(circleInfo(10))
39-
circumference, area = circleInfo(10)
40-
print(circumference)
1+
'''
2+
author : Jaydatt
3+
function syntax:
4+
5+
def function_name(arg1,arg2,....) :
6+
statement..1..
7+
statement..2..
8+
9+
10+
'''
11+
def square(x):
12+
return (x * x)
13+
14+
def sub(x, y):
15+
return (x - y)
16+
17+
print(square)
18+
print(square(3))
19+
print(sub(6, 4))
20+
21+
# return immutable tuple
22+
def circleInfo(r):
23+
cir = 2 * 3.14159 * r
24+
area = 3.14159 * r * r
25+
return cir, area # return immutable tuple
26+
# or return (cir, area)
27+
print(circleInfo(10))
28+
circumference, area = circleInfo(10)
29+
print(circumference)
30+
print(area)
31+
32+
# return mutable list
33+
def circleInfo(r):
34+
cir = 2 * 3.14159 * r
35+
area = 3.14159 * r * r
36+
return [cir, area] # return mutable list
37+
38+
print(circleInfo(10))
39+
circumference, area = circleInfo(10)
40+
print(circumference)
4141
print(area)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy