Allmäna tester

This commit is contained in:
2018-02-22 15:51:45 +01:00
parent b80d0e844a
commit c73e48da9f
2 changed files with 4 additions and 4 deletions

View File

@@ -1,4 +1,4 @@
#Python is a dynamically typed language. Python uses values not variables :) # Python is a dynamically typed language. Python uses values not variables :)
a = 100 a = 100
b = "foo" b = "foo"
c = True c = True
@@ -13,9 +13,9 @@ print(c)
print(d) print(d)
print(a+d) print(a+d)
#bunch of different ways to concatenate different datatypes, format is recommended I believe # Bunch of different ways to concatenate different datatypes, format is recommended I believe
print(str(a)+e) print(str(a)+e)
print(a,e) print(a,e)
print("Concatenate: {} {}".format(a,e)) print("Concatenate: {} {}".format(a,e))
print("Concatenate: {} {}".format(a,c)) print("Concatenate: {} {}".format(a,c))
print("Concatenate: %d %s " % (a,e)) print("Concatenate: %d %s " % (a,e))

View File

@@ -33,4 +33,4 @@ print(tuple1)
#There are even dictionaries with key/value pairing #There are even dictionaries with key/value pairing
movies = {'Pacific Rim': '5 stars', 'Black Panther': '5 stars', "Zombie Beavers":"0 stars"} movies = {'Pacific Rim': '5 stars', 'Black Panther': '5 stars', "Zombie Beavers":"0 stars"}
for i, j in movies.items(): for i, j in movies.items():
print(i,j) print(i,j)