Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

0 Endorsements
Ranked #3K
~25.0K People Reached
This member's community profile is only visible to logged in members until they have earned 15 reputation points.
Favorite Forums

14 Posted Topics

Member Avatar for Iceman10284

########################################################### # Python program that would display larger of two numbers # ########################################################### def Max(arg1,arg2): if arg1 > arg2: return arg1 else: return arg2 print "Enter first number:", a = int (raw_input("> ")) print "Enter second number:", b = int (raw_input("> ")) Max_value = Max(a,b) print "The greater of the …

Member Avatar for UNIQUE_PRINCE
-1
4K
Member Avatar for Iceman10284

just to help you, - declare a counter = 0, - array of numbers = [], - while counter < 20 - take input from users - array.append(input) - print the array - use min function to find lowest number in array - use max function to find greatest number …

Member Avatar for booicu
-1
7K
Member Avatar for peterparker

I am stuck on the final part of the query, I know that this thing is easy, but I am out of ideas now, so sorry for this. I have prepared a query like this: SELECT A.projectName as PARENT, (select COUNT(*) from PSPROJECTITEM WHERE PROJECTNAME = A.PROJECTNAME) parentprojecount, B.ProjectName as …

Member Avatar for atia.akram
0
225
Member Avatar for peterparker

I have written the following code for Towers of Hanoi problem using non recursive approach. I guess it is not correct as the number of moves are not 2*n - 1, for eg, for 3 disks to be moved, it has to generate 7 moves. Thanks in advance. ###################### # …

Member Avatar for peterparker
0
2K
Member Avatar for sarelnet

post the file first, so that i can develop the program. and to read a line with a paritcular string in python, we use startswith(str) function. for line in readlines(): if line.startswith("joker"): operations

Member Avatar for sarelnet
1
156
Member Avatar for deepthought
Member Avatar for TrustyTony
0
669
Member Avatar for 3e0jUn

myList = ['1','2','a','b'] mylist = ' '.join(list for list in myList) print "['" + mylist.replace(' ',"','") + "']" output: PS C:\Users\rk\pythonprograms> python lists.py ['1','2','a','b'] PS C:\Users\rk\pythonprograms>

Member Avatar for peterparker
0
270
Member Avatar for Member #952511

> text = str(raw_input('ttwtf$ ') text = str(raw_input('ttwtf$ ')) is the correct method

Member Avatar for HiHe
1
181
Member Avatar for peterparker

0 down vote favorite I have written a code to convert decimal numbers into hexadecimal equivalent. The program prints correct value till '2559'. How to get correct values of hexadecimal for larger numbers. Here is my code: ######################################### # Decimal to Hexadecimal Conversion # ######################################### def DectoHex(n): if n <= …

Member Avatar for peterparker
0
1K
Member Avatar for peterparker

I am learning Python through LPTHW. There is an exercise where we need to create test scenarios. The following is the code for whom Test Case have to be made: ############################# # Sentence Parser # ############################# class ParserError(Exception): pass class Sentence(Object): def __init__(self, subject, verb, object): # remember, we take …

Member Avatar for peterparker
0
273
Member Avatar for peterparker

A basic program which writes the user name who has logged in the windows machine: ###################### # User info # ###################### import os import datetime from time import strftime def foo(): usr_log = os.environ ['USERNAME'] sys_log = os.environ ['USERPROFILE'] current_time = strftime("%a, %d %b %Y %H:%M:%S") dt_str = str (datetime.date.today()) …

Member Avatar for peterparker
0
215
Member Avatar for peterparker

################################# # Learning to make a game # ################################# # An attempt to make a game # Each room will be described by a class, whose base class will be Room # The user will be prompted to enter a number, each number will be assigned with a Room in …

Member Avatar for peterparker
0
2K
Member Avatar for HankReardon

Hope this solves this, if your desired output is 1247.12: # This program demonstrates the split method. def main(): # Create a string with multiple words. my_string = '1247.123456789' # Split the string. number_list = my_string.split('.') print number_list firstString = number_list[0] print firstString secondString = number_list[1] secondString = secondString[0 : …

Member Avatar for HankReardon
0
241
Member Avatar for blackarchan

The End.