Compare commits
17 Commits
e43a072121
...
210700b6dd
Author | SHA1 | Date | |
---|---|---|---|
210700b6dd | |||
afe610bfe2 | |||
603ffc167f | |||
ed9e1847f8 | |||
f7e79be7e3 | |||
d13aef71d8 | |||
78f8cedd24 | |||
ea1f96fb56 | |||
fa01e9f5e5 | |||
f0d2e1fd08 | |||
bde4b7fbf5 | |||
01f838d55c | |||
3e5da7ba6a | |||
ba1b1f31ce | |||
3123313dc4 | |||
a7e783e361 | |||
7ac0ef9eb5 |
@ -2,5 +2,11 @@
|
|||||||
# @author 轩辕龙儿
|
# @author 轩辕龙儿
|
||||||
# @date 2022/10/25
|
# @date 2022/10/25
|
||||||
# @file NP1.py
|
# @file NP1.py
|
||||||
|
|
||||||
|
def solution():
|
||||||
s = "Hello World!"
|
s = "Hello World!"
|
||||||
print(s)
|
print(s)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
solution()
|
||||||
|
@ -2,6 +2,12 @@
|
|||||||
# @author 轩辕龙儿
|
# @author 轩辕龙儿
|
||||||
# @date 2022/10/25
|
# @date 2022/10/25
|
||||||
# @file NP10.py
|
# @file NP10.py
|
||||||
|
|
||||||
|
def solution():
|
||||||
n1 = input()
|
n1 = input()
|
||||||
n2 = input()
|
n2 = input()
|
||||||
print(n1 + n2)
|
print(n1 + n2)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
solution()
|
||||||
|
@ -2,5 +2,11 @@
|
|||||||
# @author 轩辕龙儿
|
# @author 轩辕龙儿
|
||||||
# @date 2022/10/25
|
# @date 2022/10/25
|
||||||
# @file NP11.py
|
# @file NP11.py
|
||||||
|
|
||||||
|
def solution():
|
||||||
s = input()
|
s = input()
|
||||||
print(len(s))
|
print(len(s))
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
solution()
|
||||||
|
@ -2,7 +2,13 @@
|
|||||||
# @author 轩辕龙儿
|
# @author 轩辕龙儿
|
||||||
# @date 2022/10/25
|
# @date 2022/10/25
|
||||||
# @file NP12.py
|
# @file NP12.py
|
||||||
|
|
||||||
|
def solution():
|
||||||
s = input()
|
s = input()
|
||||||
print(s.lower())
|
print(s.lower())
|
||||||
print(s.upper())
|
print(s.upper())
|
||||||
print(s.title())
|
print(s.title())
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
solution()
|
||||||
|
@ -2,5 +2,11 @@
|
|||||||
# @author 轩辕龙儿
|
# @author 轩辕龙儿
|
||||||
# @date 2022/10/25
|
# @date 2022/10/25
|
||||||
# @file NP13.py
|
# @file NP13.py
|
||||||
|
|
||||||
|
def solution():
|
||||||
s = input()
|
s = input()
|
||||||
print(s.strip())
|
print(s.strip())
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
solution()
|
||||||
|
@ -2,5 +2,11 @@
|
|||||||
# @author 轩辕龙儿
|
# @author 轩辕龙儿
|
||||||
# @date 2022/10/25
|
# @date 2022/10/25
|
||||||
# @file NP14.py
|
# @file NP14.py
|
||||||
|
|
||||||
|
def solution():
|
||||||
s = input()
|
s = input()
|
||||||
print(s * 100)
|
print(s * 100)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
solution()
|
||||||
|
@ -2,5 +2,11 @@
|
|||||||
# @author 轩辕龙儿
|
# @author 轩辕龙儿
|
||||||
# @date 2022/10/25
|
# @date 2022/10/25
|
||||||
# @file NP15.py
|
# @file NP15.py
|
||||||
|
|
||||||
|
def solution():
|
||||||
s = input()
|
s = input()
|
||||||
print(s[0:10])
|
print(s[0:10])
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
solution()
|
||||||
|
21
NP/NP16.py
Normal file
21
NP/NP16.py
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
# @author 轩辕龙儿
|
||||||
|
# @date 2022/10/26
|
||||||
|
# @file NP16.py
|
||||||
|
|
||||||
|
def solution():
|
||||||
|
nameList = ["Allen", "Tom"]
|
||||||
|
for i in nameList:
|
||||||
|
print(
|
||||||
|
"{}, you have passed our interview and will soon become a member of our company.".format(
|
||||||
|
i
|
||||||
|
)
|
||||||
|
)
|
||||||
|
nameList.remove("Tom")
|
||||||
|
nameList.append("Andy")
|
||||||
|
for i in nameList:
|
||||||
|
print("{}, welcome to join us!".format(i))
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
solution()
|
13
NP/NP17.py
Normal file
13
NP/NP17.py
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
# @author 轩辕龙儿
|
||||||
|
# @date 2022/10/26
|
||||||
|
# @file NP17.py
|
||||||
|
|
||||||
|
def solution():
|
||||||
|
s = input()
|
||||||
|
namelist = s.split(' ')
|
||||||
|
print(namelist)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
solution()
|
11
NP/NP18.py
Normal file
11
NP/NP18.py
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
# @author 轩辕龙儿
|
||||||
|
# @date 2022/10/26
|
||||||
|
# @file NP18.py
|
||||||
|
|
||||||
|
def solution():
|
||||||
|
print(list(map(int, input().split())))
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
solution()
|
11
NP/NP19.py
Normal file
11
NP/NP19.py
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
# @author 轩辕龙儿
|
||||||
|
# @date 2022/10/26
|
||||||
|
# @file NP19.py
|
||||||
|
|
||||||
|
def solution():
|
||||||
|
print(len(input().split()))
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
solution()
|
@ -3,7 +3,14 @@
|
|||||||
# @date 2022/10/25
|
# @date 2022/10/25
|
||||||
# @file NP2.py
|
# @file NP2.py
|
||||||
|
|
||||||
|
def solution():
|
||||||
s1 = "Hello World!"
|
s1 = "Hello World!"
|
||||||
s2 = "Hello Nowcoder!"
|
s2 = "Hello Nowcoder!"
|
||||||
print(s1)
|
print(s1)
|
||||||
print(s2)
|
print(s2)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
solution()
|
||||||
|
|
||||||
|
|
||||||
|
13
NP/NP20.py
Normal file
13
NP/NP20.py
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
# @author 轩辕龙儿
|
||||||
|
# @date 2022/10/26
|
||||||
|
# @file NP20.py
|
||||||
|
|
||||||
|
def solution():
|
||||||
|
nameList = input().split()
|
||||||
|
nameList.append("Allen")
|
||||||
|
print(nameList)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
solution()
|
13
NP/NP21.py
Normal file
13
NP/NP21.py
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
# @author 轩辕龙儿
|
||||||
|
# @date 2022/10/26
|
||||||
|
# @file NP21.py
|
||||||
|
|
||||||
|
def solution():
|
||||||
|
nameList = input().split()
|
||||||
|
nameList.insert(0, "Allen")
|
||||||
|
print(nameList)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
solution()
|
13
NP/NP22.py
Normal file
13
NP/NP22.py
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
# @author 轩辕龙儿
|
||||||
|
# @date 2022/10/26
|
||||||
|
# @file NP22.py
|
||||||
|
|
||||||
|
def solution():
|
||||||
|
com = input().split()
|
||||||
|
com.remove(com[0])
|
||||||
|
print(com)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
solution()
|
13
NP/NP23.py
Normal file
13
NP/NP23.py
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
# @author 轩辕龙儿
|
||||||
|
# @date 2022/10/26
|
||||||
|
# @file NP23.py
|
||||||
|
|
||||||
|
def solution():
|
||||||
|
name = input().split()
|
||||||
|
name.remove(input())
|
||||||
|
print(name)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
solution()
|
13
NP/NP24.py
Normal file
13
NP/NP24.py
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
# @author 轩辕龙儿
|
||||||
|
# @date 2022/10/26
|
||||||
|
# @file NP24.py
|
||||||
|
|
||||||
|
def solution():
|
||||||
|
names = input().split()
|
||||||
|
del names[-3:]
|
||||||
|
print(names)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
solution()
|
15
NP/NP25.py
Normal file
15
NP/NP25.py
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
# @author 轩辕龙儿
|
||||||
|
# @date 2022/10/26
|
||||||
|
# @file NP25.py
|
||||||
|
|
||||||
|
def solution():
|
||||||
|
my_list = ["P", "y", "t", "h", "o", "n"]
|
||||||
|
print(sorted(my_list))
|
||||||
|
print(my_list)
|
||||||
|
my_list.sort(reverse=True)
|
||||||
|
print(my_list)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
solution()
|
14
NP/NP26.py
Normal file
14
NP/NP26.py
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
# @author 轩辕龙儿
|
||||||
|
# @date 2022/10/26
|
||||||
|
# @file NP26.py
|
||||||
|
|
||||||
|
def solution():
|
||||||
|
num = [3, 5, 9, 0, 1, 9, 0, 3]
|
||||||
|
# print(num)
|
||||||
|
num.reverse()
|
||||||
|
print(num)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
solution()
|
18
NP/NP27.py
Normal file
18
NP/NP27.py
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
# @author 轩辕龙儿
|
||||||
|
# @date 2022/10/26
|
||||||
|
# @file NP27.py
|
||||||
|
|
||||||
|
def solution():
|
||||||
|
name = ["Niumei", "YOLO", "Niu Ke Le", "Mona"]
|
||||||
|
friends = []
|
||||||
|
friends.append(name)
|
||||||
|
food = ["pizza", "fish", "potato", "beef"]
|
||||||
|
friends.append(food)
|
||||||
|
number = [3, 6, 0, 3]
|
||||||
|
friends.append(number)
|
||||||
|
print(friends)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
solution()
|
21
NP/NP28.py
Normal file
21
NP/NP28.py
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
# @author 轩辕龙儿
|
||||||
|
# @date 2022/10/26
|
||||||
|
# @file NP28.py
|
||||||
|
|
||||||
|
def solution():
|
||||||
|
# num1 = input()
|
||||||
|
# num2 = []
|
||||||
|
# for i in range(len(num1)):
|
||||||
|
# num2.append((int(num1[i]) + 3) % 9)
|
||||||
|
# num2[0], num2[2] = num2[2], num2[0]
|
||||||
|
# num2[1], num2[3] = num2[3], num2[1]
|
||||||
|
# for i in num2:
|
||||||
|
# print(i, end="")
|
||||||
|
|
||||||
|
s = input()
|
||||||
|
print("".join(str((int(num) + 3) % 9) for num in (s[2], s[3], s[0], s[1])))
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
solution()
|
18
NP/NP29.py
Normal file
18
NP/NP29.py
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
# @author 轩辕龙儿
|
||||||
|
# @date 2022/10/26
|
||||||
|
# @file NP29.py
|
||||||
|
|
||||||
|
def solution():
|
||||||
|
num = int(input())
|
||||||
|
stack = [1, 2, 3, 4, 5]
|
||||||
|
stack.pop()
|
||||||
|
print(stack)
|
||||||
|
stack.pop()
|
||||||
|
print(stack)
|
||||||
|
stack.append(num)
|
||||||
|
print(stack)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
solution()
|
10
NP/NP3.py
10
NP/NP3.py
@ -2,5 +2,15 @@
|
|||||||
# @author 轩辕龙儿
|
# @author 轩辕龙儿
|
||||||
# @date 2022/10/25
|
# @date 2022/10/25
|
||||||
# @file NP3.py
|
# @file NP3.py
|
||||||
|
|
||||||
|
def solution():
|
||||||
|
s1 = "Hello World!"
|
||||||
|
s2 = "Hello Nowcoder!"
|
||||||
|
print(s1)
|
||||||
|
print(s2)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
solution()
|
||||||
s = input()
|
s = input()
|
||||||
print(s)
|
print(s)
|
||||||
|
18
NP/NP30.py
Normal file
18
NP/NP30.py
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
# @author 轩辕龙儿
|
||||||
|
# @date 2022/10/26
|
||||||
|
# @file NP30.py
|
||||||
|
|
||||||
|
def solution():
|
||||||
|
num = int(input())
|
||||||
|
queue = [1, 2, 3, 4, 5]
|
||||||
|
queue.pop(0)
|
||||||
|
print(queue)
|
||||||
|
queue.pop(0)
|
||||||
|
print(queue)
|
||||||
|
queue.append(num)
|
||||||
|
print(queue)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
solution()
|
14
NP/NP31.py
Normal file
14
NP/NP31.py
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
# @author 轩辕龙儿
|
||||||
|
# @date 2022/10/26
|
||||||
|
# @file NP31.py
|
||||||
|
|
||||||
|
def solution():
|
||||||
|
group_list = ["Tom", "Allen", "Jane", "William", "Tony"]
|
||||||
|
print(group_list[0:2])
|
||||||
|
print(group_list[1:4])
|
||||||
|
print(group_list[3:5])
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
solution()
|
10
NP/NP4.py
10
NP/NP4.py
@ -2,6 +2,16 @@
|
|||||||
# @author 轩辕龙儿
|
# @author 轩辕龙儿
|
||||||
# @date 2022/10/25
|
# @date 2022/10/25
|
||||||
# @file NP4.py
|
# @file NP4.py
|
||||||
|
|
||||||
|
def solution():
|
||||||
|
s1 = "Hello World!"
|
||||||
|
s2 = "Hello Nowcoder!"
|
||||||
|
print(s1)
|
||||||
|
print(s2)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
solution()
|
||||||
num = int(input())
|
num = int(input())
|
||||||
print(num)
|
print(num)
|
||||||
print(type(num))
|
print(type(num))
|
||||||
|
10
NP/NP5.py
10
NP/NP5.py
@ -2,5 +2,15 @@
|
|||||||
# @author 轩辕龙儿
|
# @author 轩辕龙儿
|
||||||
# @date 2022/10/25
|
# @date 2022/10/25
|
||||||
# @file NP5.py
|
# @file NP5.py
|
||||||
|
|
||||||
|
def solution():
|
||||||
|
s1 = "Hello World!"
|
||||||
|
s2 = "Hello Nowcoder!"
|
||||||
|
print(s1)
|
||||||
|
print(s2)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
solution()
|
||||||
name = input()
|
name = input()
|
||||||
print("I am %s and I am studying Python in Nowcoder!" % name)
|
print("I am %s and I am studying Python in Nowcoder!" % name)
|
||||||
|
10
NP/NP6.py
10
NP/NP6.py
@ -2,5 +2,15 @@
|
|||||||
# @author 轩辕龙儿
|
# @author 轩辕龙儿
|
||||||
# @date 2022/10/25
|
# @date 2022/10/25
|
||||||
# @file NP6.py
|
# @file NP6.py
|
||||||
|
|
||||||
|
def solution():
|
||||||
|
s1 = "Hello World!"
|
||||||
|
s2 = "Hello Nowcoder!"
|
||||||
|
print(s1)
|
||||||
|
print(s2)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
solution()
|
||||||
num = float(input())
|
num = float(input())
|
||||||
print("%0.2f" % num)
|
print("%0.2f" % num)
|
||||||
|
@ -2,5 +2,11 @@
|
|||||||
# @author 轩辕龙儿
|
# @author 轩辕龙儿
|
||||||
# @date 2022/10/25
|
# @date 2022/10/25
|
||||||
# @file NP7.py
|
# @file NP7.py
|
||||||
|
|
||||||
|
def solution():
|
||||||
num = float(input())
|
num = float(input())
|
||||||
print(int(num))
|
print(int(num))
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
solution()
|
||||||
|
@ -2,7 +2,13 @@
|
|||||||
# @author 轩辕龙儿
|
# @author 轩辕龙儿
|
||||||
# @date 2022/10/25
|
# @date 2022/10/25
|
||||||
# @file NP8.py
|
# @file NP8.py
|
||||||
|
|
||||||
|
def solution():
|
||||||
a = int(input())
|
a = int(input())
|
||||||
num = float(a)
|
num = float(a)
|
||||||
print(num)
|
print(num)
|
||||||
print(type(num))
|
print(type(num))
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
solution()
|
||||||
|
Loading…
Reference in New Issue
Block a user