Click here to Skip to main content
15,891,777 members
Everything / Programming Languages / Python 2.2

Python 2.2

Python2.2

Great Reads

by Marcelo Ricardo de Oliveira
How to create a pronunciation test tool using Silverlight and Python

Latest Articles

by Marcelo Ricardo de Oliveira
How to create a pronunciation test tool using Silverlight and Python

All Articles

Sort by Score

Python 2.2 

29 Apr 2012 by Marcelo Ricardo de Oliveira
How to create a pronunciation test tool using Silverlight and Python
15 Mar 2021 by Richard MacCutchan
The Python Tutorial — Python 3.7.10 documentation[^]
24 Jun 2019 by Thomas Daniels
= is the assignment operator. You want ==, the equality operator.
19 Jul 2022 by OriginalGriff
If you need to use the same numbers - and you do - then generate the randoms numbers and store them in an array: Python Arrays[^] You them modify both the mean and standard deviation code to use the data from the array instead of fetching a new...
22 Jul 2022 by Patrice T
Quote: apparently the program works well, but I needed to consider the value 0 also in the for result Try this: for i in range(0,np+1): print("%.1f" % a) a+=(l/np)
24 Jul 2022 by Richard MacCutchan
list = [3,0,1,-2] for i in range(1, len(list)): list[i] += list[i - 1] print(list) Produces: python atest.py [3, 3, 4, 2] Python test result: 0
27 Jan 2018 by Thomas Daniels
Both newjoke and the code in the while loop will ask "Did you find that funny?". So, what you see is the question getting repeated because after newjoke get called, you'll go back to the beginning of the while loop. This gives the impression of displaying a blank joke, but you just didn't hit...
27 Jan 2018 by Thomas Daniels
print("\nWell what about this:\n\n",joke) print("a", "b") will print a b with a space in-between. That's what's happening here too: it prints the "What about this" with the newlines, then a space, then the joke. Try this instead: print("\nWell what about this:\n\n" + joke)
19 Jul 2022 by CPallini
Note: your computation of the average is NOT correct: for i in range(0, 6): soma += sorteio() extracts (and sums up) 6 values, while media = soma / 5 divides by 5. Anyway, as already suggested by Griff, consider rearranging your code for...
26 Jul 2022 by OriginalGriff
Use the zip function[^]: final_list = [sum(value) for value in zip(lst, lst1)]
26 Sep 2022 by CPallini
Quote: img = cv2.cvColor(img, cv2.COLOR_BGR2RGB) Mistyping error ('t' missing): The method name is cvtColor, see Python OpenCV | cv2.cvtColor() method - GeeksforGeeks[^].
16 Feb 2023 by Richard MacCutchan
You get date and time information via datetime — Basic date and time types — Python 3.11.2 documentation[^].
13 Aug 2013 by Member 10208126
or example: consider the contents of file1.txt: 1 0 9227 1152 34 2 2 111 7622 1120 34 2 3 68486 710 1024 14 2 6 265065 3389 800 22 2 7 393152 48438 64 132 3 8 412251 46744 64 132 3 9 430593 50866 256 95 4 10 430730 ...
2 Dec 2014 by OriginalGriff
We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.Try it yourself, you may find it...
2 Dec 2014 by Sergey Alexandrovich Kryukov
Sorry, this is not a question. Remember, this is a Quick Questions & Answers forum.—SA
19 Sep 2015 by Member 11996436
here is what I wantedI wanted to fill the login form then the form in the page after I logged in And I wanted to do it in Python with a module called MechanizeAny idea?
27 Aug 2016 by Member 12706425
i had stored result in dictionary asplayerStats={'Murray':[2,2,16,143,13,142],'Djokovic':[3,1,13,142,‌​16,143],'Muguruza':[‌​0,0,1,12,2,15],'Will‌​iams':[0,1,2,15,1,12‌​]}Now i want to print output in decreasing order of ranking, where the ranking is according to the criteria 1-6 in that...
9 Nov 2017 by OriginalGriff
We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action. Read the question carefully, and...
9 Nov 2017 by Patrice T
We do not do your HomeWork. HomeWork is not set to test your skills at begging other people to do your work, it is set to make you think and to help your teacher to check your understanding of the courses you have taken and also the problems you have at applying them. Any failure of you will...
9 Nov 2017 by Member 13503527
for instance:(["one", 4, "three", 7]) would come out like:[1,4,3,7] What I have tried: def digits(lst): digits=['two','seven','three','five'] for c in '2735': s = s.replace(c, digits(int(s))) return s
27 Jan 2018 by tgspython
I'm using Python3 and I'm writing this code where it tells you a joke and asks the user if they like it. If yes, then it will print something then the program is finished. If no it will keep on telling new jokes randomly until the user says 'yes'. However, the program does run wihtout any...
27 Jan 2018 by tgspython
When I run my code there is a sort of indent at "Q:" but not "A:". Do you know why that is? It does not stop the code from running, it works, but it would look neater to me if they "Q:" and "A:" were both in line. Thanks. CODE: jokes = ["Q: What do you call a boomerang that won't come...
11 Jul 2019 by Subham Subhasis Patra
' = ' this is used for assignment operator,, but you need ' == ' for comparison .. thats why it show an invalid syntax error .. and check you ' code indentation '
11 Jul 2019 by Subham Subhasis Patra
' = ' this is used for assignment operator,, but you need ' == ' for comparison .. thats why it show an invalid syntax error .. and check you ' code indentation
30 Jul 2020 by Member 14903326
i need to convert this code to visual basic for a proyect that i did not know that was to be in viasual basic form and to be honest i don't have much time so if anyone can help me that could be amaizing What I have tried: #Se muestran los...
30 Jul 2020 by OriginalGriff
Step 1: Learn Python. Step 2: Learn VB Step 3: Use the Python code as a specification for a new VB app. Never convert languages, it doesn't produce good code in the target language because it uses a totally different framework, and the data...
30 Jul 2020 by ilmualam
Thank you so much for this kind of question. This is what I want to know, THANK YOU.
8 Nov 2020 by Richard MacCutchan
Quote: Currently in a rush to get the solution. Slow down and think about what you need to do. Rushing into code before you have planned the logic is likely to lead to a greater number of mistakes.
8 Nov 2020 by OriginalGriff
We are more than willing to help those that are stuck: but that doesn't mean that we are here to do it all for you! We can't do all the work, you are either getting paid for this, or it's part of your grades and it wouldn't be at all fair for us...
16 Mar 2021 by OriginalGriff
We are more than willing to help those that are stuck: but that doesn't mean that we are here to do it all for you! We can't do all the work, you are either getting paid for this, or it's part of your grades and it wouldn't be at all fair for us...
17 Sep 2021 by OriginalGriff
Repost: Deleted. Please do not repost your question; use the Improve question widget to add information or reformat it, but posting it repeatedly just duplicates work, wastes time, and annoys people. I'll delete this one.
24 Feb 2022 by Marguerita02
Thanks, fixed! After long searches, I found it and planning to present the homework for next week! What I have tried: I have tried it by myself but I'm still new to it, and have searched on internet,but I was warned I can't use it in the assignment
24 Feb 2022 by OriginalGriff
Quote: have searched on internet,but I was warned I can't use it in the assignment That's because the teacher needs to see your work, not someone else's - that's called "Plagiarism" and is severely frowned upon. Homework isn't given to annoy...
22 Jul 2022 by Patrice T
Quote: Not sure where to start with this question, anyone got an answer? Start by solving the problem by hand, how you solve is basically your algorithm. If problems, show your work and explain how it go wrong, we help fixing your code.
22 Jul 2022 by OriginalGriff
While we are more than willing to help those that are stuck, that doesn't mean that we are here to do it all for you! We can't do all the work, you are either getting paid for this, or it's part of your grades and it wouldn't be at all fair for...
24 Jul 2022 by Rodrigo 2022
hello guys, my question is how to relate these two lists, for example: if the DISTANCE of force 1 is 3 and this is in index 4 of the first list, the FORCE of force 1 should be found in index 4 of the second list What I have tried: from math...
24 Jul 2022 by Rodrigo 2022
how to do a sum in the list, for example [3,0,1,-2,] return [3,3,4,2], adding index by index What I have tried: list = [3,0,1,-2] total = 0 for i in list: total = total + i print(lista)
26 Jul 2022 by Richard MacCutchan
You need to use string formatting to get values printed in specific forms: formatstrings — Common string operations — Python 3.10.5 documentation[^]
31 Jul 2022 by Richard MacCutchan
You need to create a new sub-list inside list2 for each iteration of car, something like: u=0 car=3 list2 = [] for j in range(car): list2.append([]) # add a new sublist to list2 for i in range(3,10): u += (5 / 10) * -3 list2[j].append(u)...
17 Aug 2022 by OriginalGriff
While we are more than willing to help those that are stuck, that doesn't mean that we are here to do it all for you! We can't do all the work, you are either getting paid for this, or it's part of your grades and it wouldn't be at all fair for...
17 Aug 2022 by Patrice T
Quote: this code must have to change but i tried many times to fix this please help me to solve this If you don't understand what is wrong with this code, just all possible input value and see when answer goes wrong. What happen with inputs: 2 4...
25 Nov 2022 by OriginalGriff
While we are more than willing to help those that are stuck, that doesn't mean that we are here to do it all for you! We can't do all the work, you are either getting paid for this, or it's part of your grades and it wouldn't be at all fair for...
2 Dec 2022 by OriginalGriff
While we are more than willing to help those that are stuck, that doesn't mean that we are here to do it all for you! We can't do all the work, you are either getting paid for this, or it's part of your grades and it wouldn't be at all fair for...
24 Jul 2022 by Patrice T
list = [3,0,1,-2] total = 0 # you may need to create lista here for i in list: total = total + i # add total to lista here print(lista)
9 Nov 2017 by Kenneth Haugland
Some searching should do the trick: Converting Text Numbers to Numeric Values[^] Its in C#, but should be easy to understand.
26 Jul 2022 by Rodrigo 2022
how to make the result of this be [2,5,10,5.5] What I have tried: lst = [1,2,3,4] lst1 = [1,3,7,1.5] lsw=0 lsw=lst+lst1 print(lsw)
31 Jul 2022 by Rodrigo 2022
my question is how to create a loop for x lists, informing how many lists you would like, example 3, and in print it gives the result list 1=[0, -1.5, -3.0, -4.5, -6.0, - 7.5 , -9, 0, -10.5] list 2=[0, -1.5, -3.0, -4.5, -6.0, -7.5, -9.0, -10.5]...
18 Mar 2021 by Member 15021280
JUst trying to delete my question might as well edit it because I dont know how to delete. How to delete a question? JUst trying to delete my question might as well edit it because I dont know how to delete. How...
22 Jul 2022 by Rodrigo 2022
hello, apparently the program works well, but I needed to consider the value 0 also in the for result, for example if I put length 5 and points 10, it should return 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 What I have tried: from math...
26 Jul 2022 by Rodrigo 2022
how to round results to 2 decimal places? What I have tried: p=10 l=5 a=0 distance = [ ] distance.append(0) for n in range(0,p): a +=(l/p)*2.9 distance.append(a) print('distance = ',distance)
25 Nov 2022 by Member 15842988
Description: in function of the Football World Cup, a friend requested you to do a program that helps you manage information about the competition. To do this, you must implement this program in Python, which you must use text file(s), to store...
1 Dec 2022 by Member 15850922
Description: in function of the Football World Cup, a friend requested you to do a program that helps you manage information about the competition. To do this, you must implement this program in Python, which you must use text file(s), to store...
16 Jul 2023 by Joshi, Rushikesh
Hi All,I am a .Net expert and don't know much details about Python (Used python.Net long back).I came across below script from http://www.kunaldua.com/blog/2009/12/reliance-wireless-broadband-auto-login-script/[^] site.I would like to convert below code to C#, so I can create a small...
16 Jul 2023 by khalidezzat
use www.codeconvert.ai/app[^] using System; using System.Net; using System.Collections.Generic; class Program { static void Main(string[] args) { string username = "1111111111111111"; string password = "password"; ...
11 Jul 2019 by JAI_C
My code: Quote: def dave_check(user_name): if user_name= "Dave" : return "Get off my computer Dave!" # Enter a user name here, make sure to make it a string user_name = "Dave" print(dave_check(user_name)) The result: File...
8 Nov 2020 by Rajat Dammu
In a 4 × 100 meters relay event, each team consists of four runners. Each runner in a team completes 100 meters. A relay baton(a stick) is carried by each runner, after completing 100 meters, it is passed to the team member continuing the next...
19 Jul 2022 by Rodrigo 2022
hello, this program is related to the mean and standard deviation, the mean I got, but when trying to do it for the standard deviation I was not successful, I tried in different ways, I couldn't use the same numbers of the mean, because when...
22 Jul 2022 by Ishan Anand
On the planet Mongo, each year has 15 months and each month has 26 days. Write a function compute_mongo_age(birthYear, birthMonth, birthDay, currentYear, currentMonth, currentDay) that residents of Mongo can use to compute their age. It should...
26 Sep 2022 by Aya Nabil 2022
I'm a beginner to python and tried to import an image to my IDE but there is an error, I worked on the error for more than three hours but in vain could some one help me with this error, please? What I have tried: #Created by AyaNabil on...
2 Dec 2022 by User 15814964
The flying range of a fighter plane i is denoted by the pair (xi, yi). Where xi and yi are the points on an infinite coordinate line. You are given the flying ranges of 5 fighter planes in a squadron. Find whether there exists a fighter plane...
22 Jan 2023 by omar weeka
Iam using open cv and opencv to read multiple barcode scan I need to check if theres some barcode equal to each other by uaing live video by webcam i need to say of theres barcode equal to other display truee on screen theres more than one...
16 Feb 2023 by Member 15916612
I am trying to set date and time on my window 1. I don't know how to do that. Can anyone please help me. What I have tried: from tkinter import * import tkinter as tk from tkinter import messagebox import serial class Win1(tk.Frame): def...