<file_sep># Ex.4 - Variables and Names
# - Write a comment above each line explaining to yourself in English what it does.
# - Read the .py file backwardç
# - Read the .py file out loud, saying even the characters
cars = 100
space_in_a_car = 4.0
drivers = 30
passengers = 90
cars_not_driven = cars - drivers
cars_driven = drivers
carpool_capacity = cars_driven * space_in_a_car
average_passengers_per_car = passengers / cars_driven


print("There are",cars,"cars avaiable.")
print("There are only",drivers,"drivers avaiable.")
print("There will be",cars_not_driven,"Empty cars today.")
print("We can transport",carpool_capacity,"people today.")
print("We have",passengers,"to carpool today.")
print("We need to put about",average_passengers_per_car,
    "in each car.")
<file_sep># Learn_python
This repository aims to organize the readings and tutorials on learning Python 3.x.


> I suggest you copy the "*.ipynb" files on your desktop (including its folder content, if it is the case). 
> In case you didn't install the Jupyter Notebook yet, I strongly recomend you to install the last Anaconda Package.
> You can find it here: https://www.anaconda.com/distribution/#download-section
> If you are not sure if you want to install the Anaconda and Jupyter Notebook right now, you can do as follows:

- Click the "*.ipynb" link on the repository's folder;
- Copy the web location that appears on your navigator (Ex: https://github.com/daviramalho/Learn_markdown/blob/master/ex_01/Learn-Markdown.ipynb);
- Go to the [nbviewer](https://nbviewer.jupyter.org/) homepage.
- Paste the link to check the full rendered Jupyter Notebook file on your web browser.
<file_sep>#Exercise 9 -printing, printing, printing   #Use the comments here to print out
                                            #the markdown comments on the
                                            #Jupyter notebooks.
#------
#- Write down the code to apply more about the codes learnt;
#```python
#```code
#```
#------
#**<NAME>. \"Learn python 3 the hard way...\", 2017.

#Here's some new strange stuff, remember type it exactly.

days = "Mon Tue Wed Thu Fri Sat Sun"
months = "Jan\nFeb\nMar\nApr\nMay\nJun\nJul\nAug"
#With only the space the strings are printed into the same line.
print("Here are the days", days)
#Seems like the "\n" teels python to jump the string to the next line.
print("Here are the months", months)
#The more interesting here is that the the three double-quotes are used to
#write down any size of text inside of it. Seems like in this case the dot (".")
#should tell python to jump to the next line. You can check that by breaking the code.
#No. Try to understand why then the python jump the line...
print("""
There is something going on here.
With the three double-quotes.
We'll be able to type as much as we like.
Even 4 lines if we want, or 5, or 6.
""")
<file_sep>#This will print some common text
print("I will now count my chickens.")
#Next will print some common text between the quotation mark.
#The division will be made first than the addition, thats why the result will be
#30.0
#There is a ".0" after the result because of the division, that turned the number
#into a floating number. Is it right? Not sure...
print("Hens",25+30/6)
#Next the result will be 97 because the order of the operations are:
#1st."*"
#2nd."%"
#3rd."-"
#Remember that "%" here means the rest of the division
print("Roosters",100-25*3%4)
#Next should only print common text again.
print("Now I will count the eggs.")
#Next the result should be 6.75 because the order of the operations are:
#1st."%"
#2nd."/"
#Than the operations follow the order of appearance
print(3+2+1-5+4%2-1/4+6)
#Next should print common text
print("Is it true that 3 + 2 < 5 - 7?")
#Next should print false because the result is false...
print(3+2<5-7)

print("What is 3 + 2?",3+2)
print("What is 5 - 7?",5-7)

print("Oh, that's why it's False.")

print("How about some more.")
#Next should print True or False if is is so...
print("Is it greater?",5>-2)
print("Is it greater or equal?",5>=-2)
print("Is it less or equal?",5<=-2)
<file_sep>print("Mary had a little lamb.")
#The ".format('snow')" command should add a string named "snow" inside the
#curly brackets inside the phrase.
print("Its fleece was white as {}.".format('snow')) #I just didn't understand
                                                    #how does it know to do that
                                                    #because there is any
                                                    #indication os variables
                                                    #inside that brackets

#If you print next code line instead of last one, will will receive an error
#reporting some tupla problem
#print("Its fleece was {} {} {} white as {}.".format('snow'))

#Maybe next strategy solve this tupla problem:
print("Its fleece was {} {} {} white as {}.".format('sweet','soft','and','snow'))
#So the string after ".format('')" should have the same quantity of data than
#The curly bracket inside the print string.

print("And everywhere that Mary went.")
print("."*10)   #What'd that do? Repeat "." ten times.

end1="C"
end2="h"
end3="e"
end4="e"
end5="s"
end6="e"
end7="B"
end8="u"
end9="r"
end10="g"
end11="e"
end12="r"

#Watch that comma at the end. Try removing it to see what happens.
print(end1 + end2 + end3 + end4 + end5 + end6,end=' ')  #I don't know what that
                                                        #",end=''"means. seems
                                                        #it's made to append
                                                        #multiple functions.
print(end7 + end8 + end9 + end10 + end11 + end12)
<file_sep>#Exercise 8 - Printing, Printing    #Use the comments here to write markdonw
                                    #comments into Jupyter Notebooks
#------
#- Here you'll learn how to print more complex string using ".format()"
#```python
#var="{} {} {} {}"
#print(var.format(x, y, z, w))
#```
#------
#**<NAME>., \"Learn Python 3 the hard way...\", 2017.

formatter = "{} {} {} {}"

print(formatter.format(1, 2, 3, 4))
print(formatter.format("one", "two", "three", "four"))
#The strings, numbers or booleans should appear in the same order inside the
#previous defined variable.
print(formatter.format(True, False, False, True))
#Even the variable should show itself, if defined so.
print(formatter.format(formatter, formatter, formatter, formatter))
#The interesting here is the way the author uses the indentation (I think this
#is the name but I'm not sure). This is very useful and important.
print(formatter.format(
    "Try your",
    "Own text here",
    "Maybe a poem",
    "Or a song about fear"
))
<file_sep>types_of_people = 10
x = f"There are {types_of_people} types of people." #This is not a string.
#Previous one defines two variables with a numeric string, "types_of_people",
#inside another string, "x".The "f" before the string alows it to append the
#string inside the other.
binary = "binary"
do_not = "don't"
y = f"Those who know {binary} and those who {do_not}."  #There are two strings
                                                        #inside an string [1, 2]
#Now the "x" & "y" are variables so it doesn't need to use quotation mark (" or ')
#to ask to print that.
print(x)
print(y)
#Remember here the reason why to use the "f" before the string. Without it
#it wouldn't be possible to append the "x" vairable. The curly brackets ({})
#allows that to specify where the before defined variable should be appent.
print(f"I said: {x}") #This is an string inside an string [3]
print(f"I also said '{y}'") #This is an string inside an string. [4]

hilarious = False #This is an boolean value.
joke_evaluation = "Isn't that joke so funny?! {}"   #This is not a string.
#Next line will add an sting inside a string, after that been write.
print(joke_evaluation.format(hilarious))
#Next will define two variables, "w" & "e".
w = "This is the left side of..."
e = "a string with right side."
#Than next one should append "w" & "e".
print(w + e)
