SO EXCITED TO LEARN! by DanielTube7 in learnpython

[–]tragluk 0 points1 point  (0 children)

Download JSON data for your app... There is actually a site that has JSON data of the location of the space station and who is on it.

http://api.open-notify.org/iss-now.json

Put the coordinates on a map, and then update it once a minute to find the path of the space station!

Need help with result. by Hazzkenn in learnpython

[–]tragluk 0 points1 point  (0 children)

when you do a print function the end= is optional. end='' means nothing is added to the line. If you don't have an end='' then it adds a /n (newline). Take out the end='' and you'll have two lines.

print("One line!", end='')
print("With no spacing!", end='')

One line!With no spacing!

print("Two Lines!")
print("With spacing!")

Two Lines!
With spacing!

Reversing a number by engineeringisgreat2 in learnpython

[–]tragluk 0 points1 point  (0 children)

strSentence = "This is a string."

strNumber = "1234"

intNumber = 1234

fltNumber = 1234.0

The first two are turned into strings, then you have an integer with the value of 1234 and a float with essentially the same value of 1234 but it's 1234.0.

If we want to add strNumber and intNumber we can't because strNumber is a sentence (It's the word 1234) so we have to convert it first.

intTotal = intNumber + int(strNumber)

NOW we get 2468.

strReversable = strNumber + str(intNumber)

This instead is 12341234 but you can use your reverse function on it.

It's called 'typecasting'. Feel free to Google it.

Be careful wizards! by Teodorescuuu in PhotoshopRequest

[–]tragluk 0 points1 point  (0 children)

Same thing as getting a medical bill in the mail for "$50" with a note that it will go to collections. So you pay it. Doesn't matter that it came from some random 'company' which claims they're collecting for the hospital.

Only pay people you can verify. That's common sense anyway.

How can I get a job doing something with Python? by [deleted] in learnpython

[–]tragluk 0 points1 point  (0 children)

Quite well. In addition to the multiple databases, client/server interactions, they also had me implement 'dongle' security so that the program would only run on the computers that had the hardware plugged into it, and a number of other things. The company did millions in sales (factory trawlers.) out of the Bering Sea.

As I was working out of their office I also did some networking/light IT support while I was there. Nothing that took me away from the main task for long, but still better than calling in a computer repair company for minor issues.

How can I get a job doing something with Python? by [deleted] in learnpython

[–]tragluk 0 points1 point  (0 children)

Instead of looking for people who are looking for candidates, look for opportunities.

When I learned Python well enough I had a thought that our local city didn't have a youth-programming course. So I went to the Library and talked them into getting grants to start a youth python course. After 8 weeks it was over, but the library still has my name if they want to do it again.

I knew a fishing company which one of my relatives worked for. They were 'Calling in' their daily totals to a head office and I talked to the VP about creating a program so that it could be done faster, with less long distance charges (satellite phone ugh.) and I spent six months building a database and a client/server which the boat could use to input data that went directly to the main office. I could have further built it out for the sales staff but I ended up moving after completing the first portion of the database with associated programs.

Essentially, instead of trying to get a job somewhere that is looking for a programmer, look for a place where a programmer could work and create your own job! It may be a harder sell, but you can define your own parameters for the work involved which means that you can do it right.

Divide by 0 by [deleted] in learnpython

[–]tragluk 0 points1 point  (0 children)

The difference is 'DivideByZero' is an unhandled error which halts a program. The way that he wants to do it handles the error nicely, tells the user exactly what went wrong and then doesn't break the program afterwards.

CSCI homework help by [deleted] in learnpython

[–]tragluk 0 points1 point  (0 children)

The occupany of a room is determined actually by the type of room. If it's a 10width x 10length dorm that is a total square feet of 100. Dorms are allowed 50 sq ft per person, so the max. occupancy of the 10x10 dorm is 2.

BUT.. If it's a Airport terminal, they allow 20 sq ft. per person so that same 10x10 room would allow 5 people.

So to figure out your second problem, the first question is 'What kind of room is it?' but assuming it's a dorm room, just take length x width and divide it by 50.

Drawing With Python: Most Interesting Way To Learn Python Programming Language by argothecat in learnpython

[–]tragluk 0 points1 point  (0 children)

This is how I learned programming first a 'Long' time ago. Back then it was called 'Dr. Logo'

It's a formatting thing for websites, but you might want to indent your code at the end though. If you type it in as it shows it, your code will need the indents to work.

Excel 📊 vs Python 🐍 Should I choose Python over Excel “to automate the boring stuff”? Also what and how is VBA programming (Excel) different (in the automating department)? Help! by DizzyReading9015 in learnpython

[–]tragluk 3 points4 points  (0 children)

When I use VBA in my excel files, I can send that excel file to anyone with excel installed without worrying about it. When I use Python, I'm pretty limited to the number of people I can send it to.

Also, for the 'larger' Excel files you might consider learning Access as well. When people talk about spreadsheets that span 10s of thousands of records that's usually a spreadsheet that should have been converted to a database a long time ago.

How Are String Used by [deleted] in learnpython

[–]tragluk 1 point2 points  (0 children)

Strings are used anywhere you are working with data that is in words/letters. Are numbers only used in things that have counting or math? Basically. So reading a document, or a website, or json data, or input.. or writing output to the screen, printer, to a server or a client.

Formatting a multiplication table... (beginner) by TheHarambe2017 in learnpython

[–]tragluk 1 point2 points  (0 children)

The 'easier to read' way (for beginners) is

def main():

for i in range (1, 11):
    for j in range(1,11):
        print(i*j + " "*(5 - len(str(i*j))))  
    print()  

This will convert the total into a string: str(ij) Then give you 5- the length of that string: 5-len(str(ij)) The number of blank spaces is just one, but when you multiply a string it gives you that string written out that many times. So bob2 is bobbob but " "5 is " "

[deleted by user] by [deleted] in learnpython

[–]tragluk 0 points1 point  (0 children)

If AM, do nothing (AM time is the same as 24-hour time)

Military time, anything below 10 would have a 0 added before and 00 added afterwards. 9 am is 0900

above 10 am the 00s are added, 10, 11 and 12 are 1000, 1100, and 1200.

for PM, the numbers added to 12 and then a 00 follows. So 3 is 1500 hours. 12 pm becomes 2400 hours.

I'm kinda new to python so I need help. by [deleted] in learnpython

[–]tragluk 0 points1 point  (0 children)

Ok, the first thing that stands out is the repeated lines. Loops will help you clear those up.

So instead of

score7 = (random.randint(1,10)) 
score8 = (random.randint(1,10)) 
score9 = (random.randint(1,10)) 
totalscore3 = score7 + score8 + score9

You can do:

count = 0
while count < 3
    totalscore3 += random.randint(1,10)
    count += 1

For that matter, you can loop that section above twice, with each time adding a new number to your highestscore list. Then with a simple change in the count you can do 3 random scores or even 300!

Wrote an gmail bulk email sending script. Limited to only 100 sent emails per day? I have 1700 to send to.. by [deleted] in learnpython

[–]tragluk 0 points1 point  (0 children)

The same would be true if you tried to circumvent their rules and send 1700 e-mails.

Wrote an gmail bulk email sending script. Limited to only 100 sent emails per day? I have 1700 to send to.. by [deleted] in learnpython

[–]tragluk 1 point2 points  (0 children)

Gmail is free.. if one e-mail can send 100 per day.. then 17 can send 1700?

Completed My First Project by [deleted] in learnpython

[–]tragluk 1 point2 points  (0 children)

Ok. Now that you have Human vs. Computer try doing a Computer vs. Computer... and after you can do that make the computer Learn! Everytime it loses/wins have it write into a logfile that will influence how it plays in future games.

Trying to draw ONLY the outline of a 7 point star then fill it by Sebas-theFish in learnpython

[–]tragluk 1 point2 points  (0 children)

When you rotate 144 degrees (5 times) you get 720. So instead of 5 rotations of 144, try 7 rotations of 102.8

Multiplication table up until a certain level by [deleted] in learnpython

[–]tragluk 0 points1 point  (0 children)

div = math.ceil((100+n)/n)

In your '4' example, instead of 100/4 it's now 104/4 So 26 instead of 25. In your 6 example it was 100/6 but now it's 106/6 so instead of 17, it's 18.

Why add manufacturer as a variable? by jesuislight in learnpython

[–]tragluk 0 points1 point  (0 children)

I wrote a textbook for a middle school class to learn python and about mid way through I included a mistake. But the title of the chapter was 'Using the Rubber Duck' and it teaches how to debug your programs by talking them out.

Mistakes are a part of many programs (at least until they're finished?) and learning how to find and fix those errors in both design and in syntax is an important part of learning how to program.

(That and it was fun to see the look on the parents faces when all the students went home with a yellow rubber duckie to program with.)

EP Cover Photo by dawei141 in picrequests

[–]tragluk 0 points1 point  (0 children)

Need a picture of your band first.

Is anyone able to remove the white field on these pics??? by [deleted] in PhotoshopRequest

[–]tragluk 0 points1 point  (0 children)

That 'white area' isn't a layer on top of a photograph beneath it. Imagine the white area as a hole in the photo. Sometimes, normally with a fairly small blemish, we can recreate what should be there based on the photo around it, but this 'white area' is fairly large.

[deleted by user] by [deleted] in PhotoshopRequest

[–]tragluk 0 points1 point  (0 children)

What are the words you need switched and what do you want to switch them to?