-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtask1.py
More file actions
77 lines (62 loc) · 1.66 KB
/
task1.py
File metadata and controls
77 lines (62 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
age=float(input('Please enter your age: '))
if age<=30:
print("Less than 30 years old")
else:
print("Greater than 30 years old")
################
x=float(input("Enter any x: "))
x_sqr=x**3
print(x)
#################
x = list(map(int, input().split()))
print(x)
y = list(map(int, input().split()))
print(y)
import matplotlib.pyplot as plt
plt.scatter(x,y)
plt.show()
##############
i=1
n=int(input("Input how many elements in array??"))
x = [ float(input()) for i in range(n)]
################
#load library
import matplotlib.pyplot as plt
vec_x=input()
vec_y=input()
plt.scatter(vec_x,vec_y)
plt.show()
################
#load library
import datetime #as dt # time, date, datetime
today=datetime.date.today()
#print("Today year is:", today.year)
#print("Today month is:", today.month)
#print("Today day is:", today.day)
todaydate=datetime.date(month=today.month, year=today.year, day=today.day)
print("Today date is: ", todaydate)
# Birth date
year1=int(input("birth year: "))
month1=int(input("birth month: "))
day1=int(input("birth day: "))
birthdate=datetime.date(month=month1, year=year1, day=day1)
print("Birth date is: ", birthdate)
age = todaydate.year - birthdate.year - ((todaydate.month, todaydate.day) < (birthdate.month, birthdate.day))
print(age)
#################
#load library
import numpy as np
vector = np.array([1, 2, 3, 4, 5, 6])
print()
print("Original Vector:)
x=[1, 2, 3, 4, 5, 6, -10, -33, -11, -5, -2]
pos_count=0
neg_count=0
for num in x:
# checking condition
if num >= 0:
pos_count=pos_count+1
else:
neg_count=neg_count+1
print("Positive numbers in the list: ", pos_count)
print("Negative numbers in the list: ", neg_count)