Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: switch limitations
Post: RE: switch limitations

Python does not have a switch operator.You can use it with a simple if statement instead.
aakashjha001 General Coding Help 3 2,371 Jan-27-2019, 06:11 PM
    Thread: Print 2D Array
Post: RE: Print 2D Array

# this is one approach to create a 2D list in python. #There are multiple ways of creating. n = int(input()) a = [] for i in range(n): row = input().split() for i in range(len(row)): ...
aakashjha001 General Coding Help 3 2,708 Jan-27-2019, 06:09 PM
    Thread: Sum of Numbers in a List
Post: RE: Sum of Numbers in a List

#Working code lst = [] i = 0 print("Enter how many numbers:") x = input() while i < int(x): print("Enter number: ") y = input() lst.append(int(y)) i = i + 1 def sum1(): sum=...
aakashjha001 General Coding Help 8 4,374 Jan-27-2019, 06:03 PM
    Thread: Number within range
Post: RE: Number within range

Your code is correct but it needs to be converted to int. Python takes string as default input value.
aakashjha001 General Coding Help 4 3,222 Jan-27-2019, 05:51 PM
    Thread: Merge rows of 2 arrays
Post: RE: Merge rows of 2 arrays

#Here you go list1=[1,2,3,4,5] list2=[0,9,-15,5,-2245] list3=[] for i in range(0,5): list3.append(list1[i]) list3.append(list2[i]) print(list3)
aakashjha001 General Coding Help 2 1,954 Jan-27-2019, 05:45 PM
    Thread: wont print last sentence..
Post: RE: wont print last sentence..

#Put the last line outside the loop as when a equals guess the loop will break. import random a = random.randint(1,99) guess = int(input('et tal..')) print while a != guess: if guess < a: ...
aakashjha001 General Coding Help 2 2,359 Jan-27-2019, 05:38 PM
    Thread: Unexpected ininite loop behavior
Post: RE: Unexpected ininite loop behavior

while (True) is infinite by default. The value of the 2 variables are outside the loop and if you enter the values less than 0,it goes into an infinite loop
aakashjha001 General Coding Help 4 2,648 Jan-27-2019, 05:32 PM
    Thread: What is the best IDE
Post: RE: What is the best IDE

PyCharm works best for me as a text editor for Python. It's easy to avoid identation errors and much easier to install external packages. All the functions of python works on Pycharm. (Some of the oth...
aakashjha001 News and Discussions 35 13,858 Jan-27-2019, 05:26 PM
    Thread: beginner questions
Post: RE: beginner questions

#Check how each function like isdigit,isuppper etc works. def check_password(password: str): if len(password) < 10: raise Exception("password must have at least 10 characters") h...
aakashjha001 Homework 5 3,432 Jan-27-2019, 05:20 PM
    Thread: Calculating Grade Average
Post: RE: Calculating Grade Average

m1=input("Enter the marks:") m2=input("Enter the marks:") m3=input("Enter the marks:") avg=(m1+m2+m3) print(avg)
aakashjha001 Homework 5 5,017 Jan-27-2019, 04:42 PM

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020