Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 45dfcc2

Browse files
RezwanRezwan
Rezwan
authored and
Rezwan
committed
1. Introduction
1 parent 458be38 commit 45dfcc2

File tree

2 files changed

+130
-15
lines changed

2 files changed

+130
-15
lines changed

‎Input Output.py

Lines changed: 83 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,94 @@
1-
a = input() # take a string (with-space, without-space)
2-
# hello world
3-
print(a) # hello world
1+
######### take a string (with-space, without-space)
2+
a = input()
3+
print(a)
4+
'''
5+
Input:
6+
Hello World!
7+
8+
Output:
9+
Hello World!
10+
'''
11+
412

13+
######### take only one int number
14+
a = int(input())
15+
print(a)
16+
'''
17+
Input:
18+
5
19+
20+
Output:
21+
5
22+
'''
523

6-
a = int(input()) # take only one int number
7-
# 5
8-
print(a) # 5
924

10-
a = float(input()) # take only one float number
25+
######### take only one float number
26+
a = float(input())
1127
print(a)
28+
'''
29+
Input:
30+
5.6
31+
32+
Output:
33+
5.6
34+
'''
1235

13-
a = str(input()) # take only one str
36+
##### take only one str
37+
a = str(input())
1438
print(a)
39+
'''
40+
Input:
41+
Rezwan
1542
16-
a, b = map(int, input().split()) # take two numbers with only one space. like : 2 3
17-
print(a, b) # 2 3
43+
Output:
44+
Rezwan
45+
'''
1846

19-
a, b, c = map(int, input().split()) # take three numbers with only one space # 2 3 4
20-
print(a, b, c) # 2 3 4
2147

22-
# input a list
48+
49+
50+
###### take two numbers with only one space. like : 2 3
51+
a, b = map(int, input().split())
52+
print(a, b)
53+
'''
54+
Input:
55+
2 3
56+
57+
Output:
58+
2 3
59+
'''
60+
61+
62+
63+
64+
######### take three numbers with only one space
65+
a, b, c = map(int, input().split())
66+
print(a, b, c)
67+
'''
68+
Input:
69+
2 3 4
70+
71+
Output:
72+
2 3 4
73+
'''
74+
75+
76+
77+
############### input a list
2378
arr = list(map(int, input().split())) # int type array
24-
print(arr) # [1, 2, 3, 4, 5]
25-
print(*arr) # 1 2 3 4 5
79+
print(arr)
80+
print(*arr)
81+
'''
82+
Input:
83+
1 2 3 4 5
84+
85+
Output:
86+
[1, 2, 3, 4, 5]
87+
1 2 3 4 5
88+
89+
'''
90+
91+
#########################
2692

2793
a = int(input("Enter a Integer number: "))
2894
print("Entered number is %d" % a)
@@ -31,6 +97,8 @@
3197
Entered number is 233
3298
'''
3399

100+
##########################
101+
34102
a = float(input("Enter a Float number: "))
35103
print("Entered number is %f" % a)
36104
'''

‎String Formatting.py

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
######## String length, uppercase, lowercase
2+
a = input("Enter a string with uppercase and lowercase: ")
3+
print(a.upper())
4+
print(a.lower())
5+
print(len(a))
6+
'''
7+
Input:
8+
Hello World!
9+
10+
Output:
11+
HELLO WORLD!
12+
hello world!
13+
12
14+
'''
15+
16+
##### Separate string with a character
17+
print("Welcome", "to", "python", "programming", sep="*")
18+
'''
19+
Output:
20+
Welcome*to*python*programming
21+
'''
22+
23+
################################
24+
name = input()
25+
age = int(input())
26+
print(name, "is" , age, "years old!")
27+
print('%s is %d years old!' %(name, age))
28+
'''
29+
Input:
30+
Rezwan
31+
20
32+
33+
Output:
34+
Rezwan is 20 years old!
35+
Rezwan is 20 years old!
36+
'''
37+
38+
##################################
39+
a = float(input())
40+
print("Price of this t-shirt is %.10f" % a)
41+
'''
42+
Input:
43+
855.75
44+
45+
Output:
46+
Price of this t-shirt is 855.7500000000
47+
'''

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /