• Breaking News

    Saturday, November 30, 2019

    I finally did! Musician finally crosses over to programmer and makes her first program - voice tuner. learn programming

    I finally did! Musician finally crosses over to programmer and makes her first program - voice tuner. learn programming


    I finally did! Musician finally crosses over to programmer and makes her first program - voice tuner.

    Posted: 29 Nov 2019 06:55 PM PST

    So first off a big thanks to everyone who commented and helped inspire me to accomplish this, and an especially big thank you to u/davepena for your guidance to finally cross the finish line. As it seems like they're a few people interested in my last post, I wanted to post an update for everyone.

    Background: I'm a music student/teacher who wants to learn how to program a vocal tuner to help my students visualize music. After posting a question about how to make such a program, I got lots of suggestions that I looked into. Most of them were too complicated or did not allow me to make what I had pictured in my head.

    u/davepena contacted me to let me know that he thought a program he made, called StremeCoder, would be perfect for me. He even gave me a free copy and helped solve a few problems I had while figuring out how to use StremeCoder. I was surprised by how much making everything more visual helped me!

    Here's YouTube clip to show it off in action! >>> https://www.youtube.com/watch?v=iPOCdZKargUz <<<

    Feel free to DM or post any questions you have. Thanks everyone :)

    **A bunch of people have been DMing me about what I used. Here's a link for those of you who are interested in making your own dream app 🥰👍

    http://do.pluricorp.com/page/stremecoder

    **Original post here**

    https://www.reddit.com/r/MusicEd/comments/dxmdrt/musician_looking_for_help_to_take_what_ive/

    submitted by /u/Rosie_En_La_Vie
    [link] [comments]

    Want to make an AI snake game, but don't know how.

    Posted: 29 Nov 2019 08:21 PM PST

    I've programmed a working snake game already, but I don't know how to create an AI with different difficulties. Not a neural network mind you; I'm just trying to implement something simple and quick.

    Can anyone point me to some helpful resources? If wanted, it's being programmed in netlogo.

    submitted by /u/TheRealMasonMac
    [link] [comments]

    Does it make a difference whether I learn Data Structures and algorithms in Python instead of a low level language like C?

    Posted: 29 Nov 2019 08:48 AM PST

    Python is my preferred language but coding any data structure is much much easier in python than in C and I was wondering if I would miss out on something if I chose to learn D.S. in python instead of C?

    Also I'm planning to use Miller's book on DS in python incase I go along as planned. If you all have any other good resources then please do suggest.

    Thank you to everyone who helps!

    submitted by /u/sin-of-pr1de
    [link] [comments]

    The Odin Project's Full Stack JavaScript or Full Stack Ruby on Rails?

    Posted: 29 Nov 2019 09:56 AM PST

    I want to start to TOP but there are 2 tracks for Full Stack and i can't decide between them.

    Some say that ruby isn't popular anymore and node.js is the right choice, some say that you should decide by looking at the job oppurtinities in your area while others say that to get the basics you should begin with ruby on rails or it'll be hard to understand the concept. Also Node.js course on TOP is new, so i don't know if it is as good as the other one since there aren't many users who completed it.

    i must say that i'm completely lost. can you guys give me any suggestions?

    submitted by /u/soyoloyodo
    [link] [comments]

    sql online resources

    Posted: 29 Nov 2019 05:42 AM PST

    Hi guys, I'm a complete novice here, with basically no programming experience at all. I'm interested in learning sql, and I wondered if anyone knew of any (preferably free) online courses/resources I could make use of. Thanks :)

    submitted by /u/Nyxzola
    [link] [comments]

    Is it necessary to learn how programming basics (ie. variable, arithmetic operators) work in memory instead of learning just its function?

    Posted: 29 Nov 2019 11:53 PM PST

    i don't really get its significance in learning the programming language, for me i think learning how variable stores memory or how classes work in memory is insignificant in creating programs.

    submitted by /u/xZarasutox
    [link] [comments]

    Texas Instruments and Bluetooth Low Energy Code using IAR Embedded Workbench

    Posted: 29 Nov 2019 07:57 PM PST

    Hey guys, I'm currently working on a side project at home and was wondering if I can get some guidance. I'm trying to design a micro-controller such that it can calculate flow rates using a flow meter and be powered by two simple coin cell batteries.

    I initially started with a basic Arduino and simple flow meter sensor. I was able to successfully write the code and calculate the flow rates and have them displayed on a LCD display, but now I'm trying to make this portable whilst using Bluetooth.

    I did some research and ended up purchasing the CC2540EMK-USB: CC2540 USB Dongle

    https://www.ti.com/tool/CC2540EMK-USB

    I downloaded the IAR Embedded Workbench and tried running some sample code that was provided. I was able to upload sample code successfully to the evaluation module USB, but when it came down to finding the USB Dongle Bluetooth signal from my phone, I was unsuccessful.

    Some sample code I tried out was the SimpleBLEPeripheral - CC2540DK-MINIKeyfob. I tried running the simpleBLEPeripheral.h and other basic sample codes, but I cant seem to get it to work. I've also looked into the OSAL.c to make sure everything was initialized properly. I also attempted the peripheralBroadcaster that I assumed had everything I needed.

    \I'm not sure if my issue is what I am calling to be the CC2540EMK-USB. Since I am using the CC2540EMK-USB and the sample code is CC2540DK-MINIKeyfob. I read through the lines of code and it all seems to be the same though.*

    I really hope someone can help. I have been stuck on this for a few weeks now. Also, I'm a super newb when it comes to coding, so I apologize if I said anything incorrect. This has been driving me nuts, since I watched a few YouTube videos and read through the Texas Instrument forum and could not get any help.

    Anyways, thanks in advance!

    submitted by /u/smithbryanw
    [link] [comments]

    A Walk Through to Building Your Website with HTML5 and CSS3

    Posted: 29 Nov 2019 07:51 PM PST

    Hey guys, rookie here. What do you guys recommend degree wise?

    Posted: 29 Nov 2019 11:14 PM PST

    Sounds like a dumb question, but what degree actually focuses on programming? I hear a lot about Software Engineering and Computer Science, but I really dont know what these degrees entail. Its not like theres just a "programming" degree. So what should I go into that focuses on programming?

    submitted by /u/TheGodfatherDied
    [link] [comments]

    Losing track and getting lost

    Posted: 29 Nov 2019 10:56 PM PST

    Very new to Programming, only have experience with other scripting languages like HMTL/SQL web development mumbo jumbo, but haven't done much with it lately as I moved on to and starting with C# on code academy. Been doing it regularly when not at work or busy with life. So about 2-3 times a week for about an hour a session.

    Think I'm beginning to lose confidence or just losing track and not able to keep on the right path.

    Done my best to make sure my programming work station is away from all distractions, and in a comfortable area where I can focus. Lately I feel intimidated each time I try to go in and start doing anything.

    Am I just not made for this? I do enjoy it and I always think about it, especially these past few days off due to holidays and not to mention, we've been snowed in. Always find myself thinking about doing programming, but each time I begin, suddenly it becomes too overwhelming and I find myself taking many breaks to clear my mind before going back and tackling it. Eventually I just get side tracked into other errands.

    Is it helpful to read other people code to help learn how to do it? Sometimes when I read code I understand it better, not sure how many of you are bilingual or multilingual, but there are times I can read or understand it 10x better than actually doing it.

    I read HTML/CSS/SQL scripting languages and I can tell whats going on, I've read some C# and feel as if I can understand what the concept is, or it feels more comfortable and I get a lot of "ah-ha" moments.

    Alas when it comes down to actually writing a program or the code requested, my mind goes blank and I end up not knowing what to do, until I see the "sample" answer and it is clear as day. one of those 'duh, of course why couldn't I think of that. thats as clear as day".

    Should I not use Code Academy? Or should I get Code Academy Pro? Is there something else I could be doing to learn C# well enough that I could probably get an internship at a job somewhere?

    If anyone has any advice of where or what could be done to get over this hurdle, that be greatly appreciated.

    submitted by /u/FTPMystery
    [link] [comments]

    Graphs implementation in C++

    Posted: 29 Nov 2019 10:52 PM PST

    Hi, does anyone has a good resource where I can learn implementation of graphs in C++? My instructor just assumed that we would understand the implementation through different algorithms he taught us. I asked my classmates if they know about the implementation and they were blank too. We'll talk to professor in next class but for now i have a project to complete. Any help would be appreciated.

    submitted by /u/Madlockdoto
    [link] [comments]

    [Debugging] I cannot, for the life of me, get my files to link (C, C++, assembly). I've tried many examples with no success.

    Posted: 29 Nov 2019 04:48 PM PST

    I've successfully linked a C++/C and one Assembly file to make a program. But I'm hitting weird linking errors, after I've read many examples and corrected my code and .sh file multiple times.

    Compiler gives this....

     link /usr/bin/ld: control.o: in function `control': control.asm:(.text+0x54): undefined reference to `get_data' /usr/bin/ld: control.asm:(.text+0x59): undefined reference to `disp_data' /usr/bin/ld: control.asm:(.text+0x97): undefined reference to `get_data' /usr/bin/ld: control.o: in function `end': control.asm:(.text+0xa8): undefined reference to `get_sum' /usr/bin/ld: main.o: in function `main': main.c:(.text+0x3b): undefined reference to `control' collect2: error: ld returned 1 exit status 

    My main for many programs has looked this way in the past, no issues...until now.

    Main.c file: #include <stdio.h> #include <ctype.h>

     extern int control(); //adding "C" after extern doesn't help int main() { int result; result = control(); return 0; } 

    fill.c file:

     #include <iostream> using namespace std; int get_data(); int get_data() { int size = 0; cout<<("How many integers for your array?\n"); cin>>size; int array[size]; for(int i=0;i<size;++i) { cout<<("Enter an integer: "); cin>>array[i]; } //pass size to control.asm return size; } 

    display.c file:

     #include <stdio.h> #include <ctype.h> void disp_data(int , int []); void disp_data(int size, int array[]) { printf("Here are your numbers...\n"); for(int i=0;i<size;++i) { printf(" %d ",array[i]); } } 

    control.asm file:

     extern printf extern scanf extern getchar extern get_data extern get_sum extern disp_data segment .text ;code segment global abort global end segment .bss q_array resq 100000 segment .data welcome db "Are you ready? Press 'c' to continue or 'x' to exit.",10,0 stringformat db "%c", 0 check db "Are these values correct (y or n)?",10,0 segment .text control: push rbp mov rbp, rsp push rbx push rcx push rdx push rdi push rsi push r8 push r9 push r10 push r11 push r12 push r13 push r14 push r15 pushf ;push rflags call get_data ;and so on, but linker can't seem to see it "undefined reference" it says 

    sh file to compile, link, run:

     rm *.o rm *.out echo "Assemble the module control.asm" nasm -f elf64 -l control.lis -o control.o control.asm echo "Assemble the module sum.asm" nasm -f elf64 -l sum.lis -o sum.o sum.asm echo "Compile the C file main.c" gcc -c -m64 -Wall -fno-pie -no-pie -o main.o main.c -std=c11 echo "Compile the C file display.c" gcc -c -m64 -Wall -fno-pie -no-pie -o display.o display.c -std=c11 echo "Compile the C++ module fill.cpp" g++ -c -m64 -Wall -o fill.o fill.cpp -fno-pie -no-pie -std=c++14 echo "Link" g++ -m64 -o array.out control.o main.o fill.o sum.o -fno-pie -no-pie -std=c++14 echo "Run this program" ./array.out 

    I can't think of what's wrong with my sh file, even less so with my main or fill or display (they all work independently). Maybe I'm calling the functions wrong in assembly, even though I've seen and followed many examples. I've been trying on and off for a couple weeks.

    Can someone help me fix this? If there's another sub I should post to, let me know.

    submitted by /u/Red-Droid-Blue-Droid
    [link] [comments]

    [Debugging] Error while trying to add

    Posted: 29 Nov 2019 04:28 PM PST

    I'm trying to solve Project Euler problem 13 in C++, and in doing so I've created a custom class BigInteger, the code for which is here:

    class BigInteger { private: std::string num; public: BigInteger() {num = "0";} BigInteger(std::string n) {num = n;} BigInteger(const BigInteger &bi) {num = bi.num;} friend BigInteger operator + (BigInteger &bi1, BigInteger &bi2) { std::stringstream ss; int sum; int overflow = 0; int ord0 = '0'; BigInteger smallnum = bi1.num.size() < bi2.num.size() ? bi1 : bi2; BigInteger largenum = bi1.num.size() > bi2.num.size() ? bi1: bi2; int sizediff = largenum.num.size() - smallnum.num.size(); for (int i = 0; i < sizediff; i++) smallnum.num = "0" + smallnum.num; std::vector<int> digits; for (int i = smallnum.num.size() - 1; i > -1; i--) { sum = int(largenum.num[i]) - ord0 + int(smallnum.num[i]) - ord0 + overflow; digits.push_back(sum % 10); overflow = sum / 10; } if (overflow) digits.push_back(overflow); std::reverse(digits.begin(), digits.end()); for (int i = 0; i < digits.size(); i++) ss << digits[i]; return BigInteger(ss.str()); } friend std::ostream& operator << (std::ostream& output, BigInteger& bi) { output << bi.num; return output; } char& operator [] (int i) {return num[i];} }; 

    My main code is:

    std::string nums [100] = { "37107287533902102798797998220837590246510135740250", "46376937677490009712648124896970078050417018260538", {truncated}... "53503534226472524250874054075591789781264330331690" }; int main() { BigInteger sum; for (int i = 0; i < 100; i++) sum = sum + BigInteger(nums[i]); std::cout << sum; } 

    However, I keep getting the error:

    euler13.cpp:113:47: error: cannot bind non-const lvalue reference of type 'BigInteger&' to an rvalue of type 'BigInteger' for (int i = 0; i < 100; i++) sum = sum + BigInteger(nums[i]); ^~~~~~~~~~~~~~~~~~~ 

    And I don't know what it means or how to fix it. Can someone please help?

    submitted by /u/TuttleStripes
    [link] [comments]

    hackathon partner

    Posted: 29 Nov 2019 06:39 PM PST

    Hi guys.

    I am a high schooler in the Bay Area California.I am looking for 3 other programmers who are interested in hackathons.

    I'm looking for web developers, people who know AI, and know basic programming languages: python, java, node.js.

    I know ML with tensorflow, python, node.js, java, MongoDB, APIs with flask, html, and css.

    If you are interested in joining the team, add me on discord and send me a message or just dm here on reddit.

    join server to contact me: https://discord.gg/J84kKta
    discord: trashcanolives#1102

    submitted by /u/trashcanolives
    [link] [comments]

    How do I establish a remote connection using Datagram?

    Posted: 29 Nov 2019 10:15 PM PST

    Hi all, I'm looking for a way to connect me to my friend on a remote computer using datagram and a server we have set up. Our goal is to make a little chat room using only Java. So far we have managed to get the client to connect to the server on its computer (Aka he can connect to the server when he runs it and I can't and vice verca). We have tried looking all over google and stack overflow for different tutorials but none seem to explain how to connect to a remote host. We have tried different .connect and .bind configurations but nothing seems to work. There is a lot of code and not much makes sense if I don't put all of it so I'm sorry for the insanity. This is our server file. We want to be able to connect to this by using the client file.

    package server; import java.net.DatagramPacket; import java.net.DatagramSocket; import java.net.InetAddress; import java.net.InetSocketAddress; import java.util.ArrayList; public class Server { private static DatagramSocket socket; private static boolean running; private static int ClientID; // Ensures that no two users have the same client ID private static ArrayList<ClientInfo> clients = new ArrayList<ClientInfo>(); public static void start(int port) { try { socket = new DatagramSocket(null); InetSocketAddress address = new InetSocketAddress("192.168.2.5", port); socket.bind(address); System.out.println("Application Starting..."); running = true; listen(); System.out.println("Server started on port: " + port); System.out.println("Server started on IP: " + socket.getLocalAddress()); } catch (Exception e) { System.out.println("Failed somewhere"); e.printStackTrace(); } } private static void broadcast(String message) { for (ClientInfo info : clients) { send(message, info.getAddress(), info.getPort()); } } private static void send(String message, InetAddress address, int port) { try { message += "\\e"; byte[] data = message.getBytes(); DatagramPacket packet = new DatagramPacket(data, data.length, address, port); socket.send(packet); System.out.println("Sent message to: " + address.getHostAddress() + " : " + port); } catch (Exception e) { e.printStackTrace(); } } private static void listen() { Thread listenThread = new Thread("ChatProgram Listener Thread") { public void run() { try { while(running) { byte[] data = new byte[1024]; DatagramPacket packet = new DatagramPacket(data, data.length); socket.receive(packet); String message = new String(data); //Identify where the end of the message is message = message.substring(0, message.indexOf("\\e")); //Manage message if(!isCommand(message, packet)) { broadcast(message); } } } catch(Exception e){ e.printStackTrace(); } } }; listenThread.start(); } /* * SERVER COMMAND LIST \con:[name] -> Connects client to server \dis:[id] -> * Disconnects client from server * * * */ private static boolean isCommand(String message, DatagramPacket packet) { if (message.startsWith("\\con:")) { // RUN CONNECTION CODE String name = message.substring(message.indexOf(":") + 1); clients.add(new ClientInfo(name, ClientID++, packet.getAddress(), packet.getPort())); broadcast("User " + name + " Connected!"); return true; } if (message.startsWith("\\dis:")) { // RUN DISCONNECTION CODE return true; } return false; } public static void stop() { running = false; } } 

    This is our client file. We believe that this is where we are getting the issue, however, we don't know.

    package client; import java.net.DatagramPacket; import java.net.DatagramSocket; import java.net.InetAddress; import java.net.InetSocketAddress; import server.ClientInfo; public class Client { private DatagramSocket socket; private InetAddress address; private int port; private boolean running; private String name; public Client(String name, String address, int port) { try { this.name = name; this.address = InetAddress.getByName(address); this.port = port; socket = new DatagramSocket(); socket.connect(this.address, port); running = true; listen(); send("\\con:" + name); } catch (Exception e) { e.printStackTrace(); } } public void send(String message) { try { if (!message.startsWith("\\")) { message = name+": "+message; } message += "\\e"; byte[] data = message.getBytes(); DatagramPacket packet = new DatagramPacket(data, data.length, address, port); socket.send(packet); System.out.println("Sent message to," + address.getHostAddress() + ":" + port); } catch (Exception e) { e.printStackTrace(); } } private void listen() { Thread listenThread = new Thread("ChatProgram Listener Thread") { public void run() { try { while (running) { byte[] data = new byte[1024]; DatagramPacket packet = new DatagramPacket(data, data.length); socket.receive(packet); String message = new String(data); // Identify where the end of the message is message = message.substring(0, message.indexOf("\\e")); // Manage message if (!isCommand(message, packet)) { ClientWindow.printToConsole(message); } } } catch (Exception e) { e.printStackTrace(); } } }; listenThread.start(); } private static boolean isCommand(String message, DatagramPacket packet) { if (message.startsWith("\\con:")) { // RUN CONNECTION CODE return true; } if (message.startsWith("\\dis:")) { // RUN DISCONNECTION CODE return true; } return false; } } 

    For something a little more in-depth about our problem my friend has a wonderful stack overflow question made and it could bring to light a little more about our issue.

    https://stackoverflow.com/questions/59113686/chat-program-client-to-server-connectivity-issue

    Thank you again for the help it is truly appreciated.

    Your new programmer, Clint.

    submitted by /u/clint59876
    [link] [comments]

    What are the best sources to learn the concepts/theories behind computer science?

    Posted: 29 Nov 2019 11:41 AM PST

    All online courses and sources just teach you programming languages, but nobody teaches the cores of computer science. I don't know what a stack is. I don't know what a data structure is. I don't know what abstraction is. I don't know what multithreading is.

    But man am I glad I can define a variable in 20 different languages!

    Any recommendations besides college tuition? Is this something I can teach myself?

    submitted by /u/UglyStru
    [link] [comments]

    How to get ctype library running on mac (Python)

    Posted: 29 Nov 2019 10:07 PM PST

    So, I am having trouble running my code on mac. It was made in windows and works perfectly fine it, but now that I am using a mac, It doesn't seem to work no more. From my research on the internet, I have found that the ctype library, specifically windll and the windows api is not compatible with mac. So, I tried doing it the linux way.... Here is my code:

    from ctypes import *

    libc = CDLL("libc.dylib.6")

    def gotoxy(x, y):

    h = libc.kernel32.GetStdHandle(STD_OUTPUT_HANDLE)

    libc.kernel32.SetConsoleCursorPosition(h, COORD(x, y))

    I keep getting an image not found, to which I think I found the reason for. I searched my mac, and it seems that I do NOT have libc.dylib.6 on it. I do however have libc.dylib, which is different (I think?) and so I tried replacing that in my code. But then I got this error instead:

    AttributeError: dlsym(0x114330f98, kernel32): symbol not found

    I don't know what to do and have been stuck on this same problem for hours. Please send help ;_;

    oh, and if it isn't so obvious, What i am trying to do is to set the cursor to specific position. Also, I am using python 3.8.

    submitted by /u/Jr194
    [link] [comments]

    Any good guides for building and hosting a personal website?

    Posted: 29 Nov 2019 06:06 PM PST

    I want to code my own website, but all the pricing for domains and hosting is pretty overwhelming.

    I was looking at hosting through Bluehost and there is a lot going on, with different packages and pricing and such. Right now, I just want to reserve a domain with "my name + .com" and later buy space to host but it seems like they all have things like WordPress instead of being able to put up files myself. How do you host a site you built from scratch? Any advice or resources are greatly appreciated.

    submitted by /u/Skate4Christ
    [link] [comments]

    Encryption Software

    Posted: 29 Nov 2019 09:47 PM PST

    i'm somewhat new to programming so this might be a bad question but how to create an encryption software similar to bit-locker? i want it to have a complex algorithm such as 256AES (better if possible) and the ability to encrypt full drives. what languages / API should i use and how should i tackle a project like this? any help is appreciated.

    submitted by /u/Ali-sultan2154
    [link] [comments]

    [RUBY] How to change response based on if user input is a string or integer

    Posted: 29 Nov 2019 09:47 PM PST

    Hi everyone! So this is just a simple journal/diary program I am trying to build and I am having a bit of trouble. I have it coded all the way down to asking the user if they would like to search by index entry or by instead typing in that they would like to search by term. The problem is I have no idea how to do this :(.

    Heres what I have so far:

    puts 'Type in as many words as you\'d like. When you\'re finished, press enter on an empty line'

    array = []

    input = ' '

    while input != ''

    input = gets.chomp

    array.push input

    end

    loop do

    puts "Great! If you wish to recall a previous entry please insert the number of it below! If you can not recall the number of the entry then please type Search"

    ans = gets.chomp.to_i

    if ans > 0 && ans <= array.length

    puts "The element at position #{ans} is " + array[ans-1]

    break

    elsif ans < 0

    puts "You have to pick a number greater than 0!"

    I can get it to work if they just enter an integer but have no idea what to do if I want the program to decide if its an integer or string.

    Heres what I would like to happen next:

    if user input = integer then puts corresponding index (already have this)

    if user input = "Search" then puts "What would you like to search for?

    Any help with this would be greatly appreciated!

    submitted by /u/Nanopixel
    [link] [comments]

    Mechanical Engineer Junior/Sophomore major here with a CS minor looking for an internship in software engineering. Any tips or things to do to get an internship for next summer?

    Posted: 29 Nov 2019 09:13 PM PST

    I have a bit of experience in C++ and have recently started learning python but I think that the only project that I've really done so far make a discord bot. I've been doing some data analytics with python and I'm pretty decent with algorithms in general. I want a job in software engineering and I need an internship to make sure that happens. How would I make myself stand out without barely any work to show for it and a ME major instead of CS. I honestly don't even have a resume because I'm not confident to put it out there. I'm currently trying to find a larger project to build for myself but I don't have any ideas currently. I wanted to work on some open source c++ stuff I found an interest in but I think it would take me too long to get familiar with it. Any help will be appreciated.

    submitted by /u/cj6464
    [link] [comments]

    How do I open and view DXT files?

    Posted: 29 Nov 2019 09:13 PM PST

    They are DirectX Texture files, however I do not know what program to use to open and view them.

    submitted by /u/GeneralHyde
    [link] [comments]

    While loop comparison between elements in list of list

    Posted: 29 Nov 2019 09:00 PM PST

    I'm trying to compare similarities of 2 elements in a list of user and their given answers as an integer, in percentages with a user given input limit, How to identify based on user input, separate and compare only integer values in a while loop?

    Eg

    You can check up to 3 pairs

    Please provide the first name in the pair (or END to finish) ==> A

    Please provide the second name in the pair ==> B

    ** Sorry! at least one name is not in the data

    Another pair? provide the first name (or END to finish) ==> AAAAA

    Please provide the second name in the pair ==> AAAAA

    TRACE similars 21

    ** A and B really have a lot in common (>90%)!

    Another pair? provide the first name (or END to finish) ==> AAAAA

    Please provide the second name in the pair ==> K

    TRACE similars 5

    ** A and K have just few opinions in common (<50%)! ***** Sorry you cannot check more pairs.. you reached the maximum: 5

    My attempt

    maxPairs = int(input("What is the maximum number of pairs you want to try? ==> ")) list=[A 1 2, B 4 5,C 6 7] listofLists=[[A 1 2],[B 4 5],[C 6 7] firstname=int(input("Please provide the first name in the pair (or END to finish) ==>")) if firstname!='END': secname=int(input("Please provide the first name in the pair (or END to finish) ==>")) else: sys.exit numP=0 while numP<maxPairs: for lst in range (listofLists): if firstname=listofLists[lst]: pear=item[0]=listofLists[lst] itemlist[0]==listofLists listst==listoflists[lst[1]] if secname=listofLists[lst]: pear=item[0]=listofLists[lst] itemlist[0]==listofLists seclistst==listoflists[lst[1]] if lstst=seclistst: print(firstname ,"and", secname, "really have a lot in common (>90%)!") else: print("** Sorry! at least one name is not in the data") ??????Don't know how to calculate percentages of comparison between lists. nump+=1 
    submitted by /u/DankeMemeses
    [link] [comments]

    Is brilliant.org good for someone soon to go into math and computer science?

    Posted: 29 Nov 2019 10:26 AM PST

    I really want to better my problem solving skills. I hope this is a good idea. Secondary Question: I don't know all of python I barely know the basics. Is it OK to continue doing the r/dailyprogrammer questions still?

    submitted by /u/Phantom099
    [link] [comments]

    No comments:

    Post a Comment