Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 1fe0ac1

Browse files
Update and rename 1 Variables.py to 2 Variables.py
1 parent 1f661d9 commit 1fe0ac1

File tree

2 files changed

+39
-2
lines changed

2 files changed

+39
-2
lines changed

‎1 Variables.py

Lines changed: 0 additions & 2 deletions
This file was deleted.

‎2 Variables.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
x = 5
2+
y = "Mani"
3+
print(x)
4+
print(y)
5+
6+
x = 4 # x is of type int
7+
x = "Raj" # x is now of type str
8+
print(x)
9+
10+
#Casting
11+
x = str(3) # x will be '3'
12+
y = int(3) # y will be 3
13+
z = float(3) # z will be 3.0
14+
15+
#Get the type
16+
x = 5
17+
y = "Mani"
18+
print(type(x))
19+
print(type(y))
20+
21+
#Single or Double Quotes?
22+
x = "Mani"
23+
# is the same as
24+
x = 'Raj'
25+
26+
#Case-Sensitive
27+
#Variable names are case-sensitive.
28+
a = 4
29+
A = "Sagi"
30+
#A will not overwrite a
31+
32+
33+
#Legal variable names:
34+
myvar = "John"
35+
my_var = "John"
36+
_my_var = "John"
37+
myVar = "John"
38+
MYVAR = "John"
39+
myvar2 = "John"

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /