-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhello.py
More file actions
113 lines (69 loc) · 1.55 KB
/
hello.py
File metadata and controls
113 lines (69 loc) · 1.55 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
89
90
91
92
93
94
# print("hello world")
# print("hamza")
# name="hamza"
# class1="waqas"
# print(class1)
# print(name)
# print(id(name))
# first_name="ali"
# print(first_name)
# # mymathsmarks=45
# myMathsMarks=34
# MyMathsMarks=45
# my_maths_marks=50
# # print(mymathsmarks)
#age=20
# name="ali"
# name="ali"
# Name="ali khan"
# name="ali"
# name="ali"
# name="ali"
# user input in python
# email=input("Enter your Email here : ")
# password=input("Enter your password here : ")
# print(email)
# print(password)
# name="ali"
# age=20
# isPythonFun=True
# percentage=99.9
# print(type(name))
# print(type(age))
# print(type(isPythonFun))
# print(type(percentage))
# take two number form the user and print the sum of that number
# String concatenation in python
# first_name="zaryab"
# last_name="khan"
# print("zaryab", "khan")
# print(first_name)
# first_number=int("20")
# second_number=int("30")
# sum=first_number+second_number
# print(sum)
# int_number=40
# str_number=str(int_number)
# float_number=float(int_number)
# print(type(int_number))
# print(type(str_number))
# print(type(float_number))
# print(float_number)
# implcit type casting and explict type casting
num1=30
num2=40.0
print(num1+num2)
# to swap to variales values
apple="apple"
mango="mango"
temp=apple
apple=mango
mango=temp
print("apple :"+apple)
print("mango :"+mango)
# sum of two digits
number=input("Enter a number to add it's digits : ")
first_digit=int(number[0])
second_digit=int(number[1])
sum=first_digit+second_digit
print("the digit sum of given number is : "+ str(sum))