-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoops.py
More file actions
107 lines (72 loc) · 2.13 KB
/
Copy pathoops.py
File metadata and controls
107 lines (72 loc) · 2.13 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#syntax
# class classname():
#class body
# class january():#class definition
# name = "kiran" #attributes
# name_2 = "charan" #attributes
# def details(self):#methods
# print("this is class methods")
# print(self.name)
# def details_1(self):#methods
# print("this is class method 2")
# self.details()
# #syntax
# #objectname = classname()
# obj = january()
# # print(obj.name)
# # print(obj.name_2)
# # obj.details()
# obj.details_1()
# class Mobiles():
# brand_name = "Samsung"
# brand_color = "white"
# storage = "128GB"
# def calling(self,brand):
# print("you are calling...!!",brand)
# def camera(self):
# print("capturing photo....")
# def browsing(self):
# print("you are browsing..")
# self.calling("oppo")
# #objectname = classname()
# samsung = Mobiles()
# print(samsung.brand_name)
# samsung.calling("samsung")
# # samsung.browsing()
# # samsung.camera()
# apple = Mobiles()
# apple.calling("apple")
# oppo = Mobiles()
# oppo.calling("oppo")
# oppo.browsing()
# class car():
# def __init__(self,bn,color,model):
# self.bn = bn
# self.color = color
# self.model = model
# def driving(self):
# print("you are driving",self.bn)
# def engine(self):
# print("start/off")
# tata = car("tata","white",2024)
# mahendra = car("mahendra","black",2023)
# tata.driving()
# mahendra.driving()
# class atm():
# def __init__(self,bn):
# self.bn = bn
# def credit(self):
# def withdraw(self):
# def bal(self):
# sbin = atm("sbin")
# sbin.credit()
# Write a Python function square_all(numbers) that takes a list of numbers as input and returns a new list containing the square of each number in the input list. Use the map() function with a lambda function to implement this.
# numbers = int(input("enter the number:"))
# obj = map(lambda i:i**2,list(numbers))
# print(list(obj))
# def square_all(numbers):
# return list(map(lambda x:x**2,numbers))
# user = input("enter numbers:")
# numbers = list(map(int,user.split()))
# square = square_all(numbers)
# print(square)