• API
• FAQ
• Tools
• Archive
daily pastebin goal
52%
SHARE
TWEET

# Untitled

a guest Feb 20th, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
1. # 1
2. for i in range(2000, 3201):
3.     if (i % 7 == 0) and (i % 5 != 0):
4.         print(i, end=",")
5.
6. # 2
7. numbers = input().split(",")
8. tuple_type = tuple(numbers)
9. print(numbers)
10. print(tuple_type)
11.
12. # 3
13. mylist = input().split(",")
14. mylist.sort()
15. print(",".join(mylist))
16. # 4
17. mydata = input().split()
18. remove_same_data = set(mydata)
19. print(" ".join(sorted(remove_same_data)))
20.
21. # 5
22. for i in range(1000, 3001):
23.     if i % 2 == 0:
24.         print(i, end=",")
25.
26. # 6
27. input_string = input()
28. digit = 0
29. letters = 0
30. for i in input_string:
31.     if i.isdigit():
32.         digit += 1
33.     elif i.isalpha():
34.         letters += 1
35. print("LETTERS", letters)
36. print("DIGITS", digit)
37.
38. # 7
39. input_string = input()
40. upper = 0
41. lower = 0
42. for i in input_string:
43.     if i.isupper():
44.         upper += 1
45.     elif i.islower():
46.         lower += 1
47. print("UPPER CASE", upper)
48. print("LOWER CASE", lower)
49.
50. # 8
51. numbers = input().split(",")
52. list_comp = [i for i in numbers if int(i) % 2 == 1]
53. print(" ".join(list_comp))
54.
55. # 9
56.
57.
58. def sum_of_two(a, b):
59.     return a+b
60.
61.
62. number_one = int(input("Enter First Number"))
63. number_two = int(input("Enter Second Number"))
64. print(sum_of_two(number_one, number_two))
65.
66. # 10
67.
68.
69. def int_to_str(a):
70.     return str(a)
71.
72.
73. value = int(input("Enter A Number"))
74. print(int_to_str(value))
75.
76. # 11
77.
78.
79. def str_to_int(a, b):
80.     return int(a)+int(b)
81.
82.
83. value_one = input("Enter The First Number")
84. value_two = input("Enter The Second Number")
85. print(str_to_int(value_one, value_two))
86.
87. # 12
88.
89.
90. def odd_or_even(number):
91.     if number % 2 == 0:
92.         return "It is an even number"
93.     else:
94.         return "It is an odd number"
95.
96.
97. value = int(input("Enter A Number"))
98. print(odd_or_even(value))
99.
100. # 13
101.
102.
103. def square_of_numbers():
104.     data = []
105.     for i in range(1, 21):
106.         data.append(i*i)
107.     return data[:5]
108.
109.
110. print(square_of_numbers())
111.
112. # 14
113.
114.
115. def exponent_of_numbers():
116.     data = []
117.     for i in range(1, 21):
118.         data.append(i**i)
119.     return data[-5:]
120.
121.
122. print(exponent_of_numbers())
123.
124.
125. # 15
126. data = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
127. count_half = len(data)//2
128. first_half = data[:count_half]
129. last_half = data[count_half:]
130. print("First Half", first_half)
131. print("Last Half", last_half)
132. # 16
133. choice = input()
134. if choice == 'yes' or choice == 'YES' or choice == 'Yes':
135.     print("Yes")
136. else:
137.     print("No")
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.

Top